I want to implement a picture and a list of titles below. I don’t know how to position the title dt under the picture dd? The code is as follows
Model Game News
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档 </title> <style type="text/css"> .list{ width:400px; height:70px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto;text-align:center; } .list dl{ float:left; margin-left:10px;} .list dd{ width:auto; margin:0px;} .list dt{ margin:0px;} </style> </head> <body> <div class="list"> <dl> <dd> <img src="http://avatar.profile.csdn.net/D/B/D/2_zh050317.jpg" /> </dd> <dt>1 </dt> </dl> <dl> <dd> <img src="http://avatar.profile.csdn.net/D/B/D/2_zh050317.jpg" /> </dd> <dt>2 </dt> </dl> <dl> <dd> <img src="http://avatar.profile.csdn.net/D/B/D/2_zh050317.jpg" /> </dd> <dt>3 </dt> </dl> </div> </body> </html>
Why use such a strange method?
I always thought that dl dt dd is sequential and cannot be changed. I have learned a lot
Simplify the code on the second floor:
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
Just write: margin:0px auto; That’s it
That’s okay too
That’s okay But don’t you think it’s a waste of time? Make it easier and faster.