Dl dt dd

Source: Internet
Author: User

Generally, we only use ul and li tags when creating a list. DL is rarely used. It also belongs to the List class label. The following describes the general usage:
<Dl> A tag defines a definition list. entries in the definition list are marked by using <dt> ("definition title", defining the title) and <dd> MARK ("definition description. The <dt> term name and the <dd> tag define the term.
That is, <dt> is used to create upper-level projects in the list, and <dd> is used to create the lowest-level projects in the list, both <dt> and <dd> must be placed between <dl> </dl> flag pairs.
<Dl>
<Dt> we are working on the list title </dt>
<Dd> List </dd>
<Dd> List </dd>
<Dd> List </dd>
<Dd> List </dd>
</Dl>

 

The list element ul ol li dl dt dd, commonly used in div css webpage layout, should be used as little as possible. Like table, the fewer nesting, the better

Ol ordered list.

<Ol>
<Li> ...... </Li>
<Li> ...... </Li>
<Li> ...... </Li>
</Ol>
Performance:
1 ......
2 ......
3 ......
Ul unordered list, represented by a large circle before li rather than 123
<Ul>
<Li> ...... </Li>
<Li> ...... </Li>
</Ul>
Many people tend to ignore the use of dl dt dd.
Dl content Block
Title of the dt content Block
Dd content
This can be written as follows:
<Dl>
<Dt> title </dt>
<Dd> content 1 </dd>
<Dd> content 2 </dd>
</Dl>
You can add ol ul li and p to dt and dd.
After understanding this, it is much easier to use div layout.

Dl: indicates the HTML custom list
Dt: indicates the HTML custom list group.
Dd: Description of the HTML custom list

Dt mainly includes the label part, and dd mainly includes input or other parts.

Note: like the label layout, the 3px BUG of IE exists.
HTML code

 

<! 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 = UTF-8"/>
<Title> describe the layout using dl, dt, and dd </title>
<Style type = "text/css" media = "all">

*{
Margin: 0;
Padding: 0;
}

Input, select {
Font-family: Arial, Helvetica, sans-serif;
Font-size: 12px;
}

. Required {
Font: 0.8em Verdana! Important;
Color: # f68622;
}

. Explain {
Color: #808080;
}

. B {
Font-weight: bold;
Font-size: 12px;
}

. Democss {
Font: 11px/12px Arial, Helvetica, sans-serif;
Color: #333;
}

. Democss dl {
Width: 420px;
}

. Democss dt {
Width: 110px;
Float: left;
Padding: 4px;
Padding-top: 8px;
Text-align: right;
}

. Democss dd {
Margin: 0 0 0 118px;
Padding: 4px;
Text-align: left;
}

. Democss input {
Width: 180px;
}

. Democss select # content {
Width: 185px;
}

. Democss input. submit {
Width: 70px;
}

Div # submit {
Width: 298px;
Text-align: left;
Padding: 4px;
Padding-left: 122px;
}

* Html. democss input, * html. democss select {
Margin-left:-3px;
}

* Html div # submit input {
Margin-left: 0px;
}

</Style>
</Head>

<Body>
<Form id = "demoform" class = "democss" action = "">

<Dl>
<Dt> <span class = "required"> * </span> <label for = "fname" accesskey = "F"> First name: </label> </dt>
<Dd> <input type = "text" id = "fname" value = "/> </dd>
<Dt> <span class = "required"> * </span> <label for = "lname" accesskey = "L"> Last name: </label> </dt>
<Dd> <input type = "text" id = "lname" value = "/> </dd>
<Dt> <span class = "required"> * </span> <label for = "content" accesskey = "C"> Preferred content: </label> </dt>
<Dd> <select name = "content" id = "content">
<Option value = "us" selected = "selected"> Yahoo! U. S. </option>
<Option value = "e1"> Yahoo! U. S. in Spanish </option>
<Option value = "b5"> Yahoo! U. S. in Chinese </option>
<Option value = "cn"> Yahoo! China </option>
<Option value = "uk"> Yahoo! United Kingdom </option>
<Option value = "ar"> Yahoo! Argentina </option>
<Option value = "aa"> Yahoo! Asia </option>
<Option value = "au"> Yahoo! Australia </option>
<Option value = "br"> Yahoo! Brazil </option>
<Option value = "ca"> Yahoo! Canada in English </option>
<Option value = "cf"> Yahoo! Canada in French </option>
<Option value = "fr"> Yahoo! France </option>
<Option value = "de"> Yahoo! Germany </option>
<Option value = "hk"> Yahoo! Hong Kong </option>
<Option value = "in"> Yahoo! India </option>
<Option value = "it"> Yahoo! Italy </option>
<Option value = "kr"> Yahoo! Korea </option>
<Option value = "mx"> Yahoo! Mexico </option>
<Option value = "sg"> Yahoo! Singapore </option>
<Option value = "es"> Yahoo! Spain </option>
<Option value = "tw"> Yahoo! Taiwan </option>
</Select>
</Dd>
<Dt> <span class = "required"> * </span> <label for = "sex" accesskey = "G"> Gender: </label> </dt>
<Dd> <select name = "sex" id = "sex">
<Option value = ""> [Select] </option>
<Option value = "m"> Male </option>
<Option value = "f"> Female </option>
</Select>
</Dd>
<Dt> <span class = "required"> * </span> <label for = "yid" accesskey = "Y"> Yahoo! ID: </label> </dt>
<Dd> <input type = "text" value = "" id = "yid"> <span class = "B"> @ yahoo.com </span> <br/>
<Span class = "explain"> ID may consist of a-z, 0-9, underscores, and a single dot (.) </span> </dd>
<Dt> <span class = "required"> * </span> <label for = "pw" accesskey = "P"> Password: </label> </dt>
<Dd> <input type = "password" value = "" id = "pw"/> <br/>
<Span class = "explain"> Six characters or more; capitalization matters! </Span>
</Dd>
<Dt> <span class = "required"> * </span> <label for = "pw2" accesskey = "R"> Re-type password: </label> </dt>
<Dd> <input type = "password" value = "" id = "pw2"/> </dd>
</Dl>

<Div id = "submit">
<Input type = "submit" value = "Submit" class = "submit"/> <input type = "reset" value = "Reset" class = "submit"/>
</Div>

</Form>
</Body>
</Html>

 

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.1 // EN"
Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd>
<Html xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "en">
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8"/>
<Title> definition list fun </title>
<Style type = "text/css">
/* Key style rules */
Dl, dl * {margin: 0 ;}
Dt {display: run-in ;}
Dt: after {content: "AA";}/* the line-breaks */
Dd {display: block ;}

/* Your own style rules */
Dl {
Font-family: Verdana; font-size: small; display: block; width: 400px;
}
Dt {
Border-bottom: 1px dotted #000;
}
Dd {
Background-color: lightgrey;
Outline: 1px solid darkgrey;
Padding: 10px 50px 10px 10px;
}
</Style>
</Head>
<Body>

<Dl>
<Dt> CSS </dt> <dd> A styling language by the W3C to facilitate semantic markup. </dd>
<Dt> XSL </dt> <dd> An alternative styling language based on XML by the W3C. </dd>
<Dt> SVG </dt> <dd> A markup language for describing vector graphics by the W3C. </dd>
</Dl>

</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.