Home > Web Front-end > HTML Tutorial > How to locate dl dt dd? _html/css_WEB-ITnose

How to locate dl dt dd? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:41
Original
1325 people have browsed it

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





Untitled Document







1


2




3







Reply to discussion (solution)

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> 
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template