OL, UL, Li, DL, DT, DD usage in CSS/Div

Source: Internet
Author: User
Div + CSS label ul ol Li dl dt dd usage ul ol Li DL dt
Dd is what Div + CSS is used for the growth of web pages. It is equivalent to the tree technique of a tree. Next we will take a look at the usage of these things. I use dd, DT, and DD very little, knowing how to use it in combination is very beneficial to the architecture!

Div
Definition of list element ul ol Li dl dt dd commonly used in CSS web page layout. Block-level element Div 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 are easy to ignore
Dl dt dd usage
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>
DT
And dd can be added to ol ul Li and P
After understanding this, it is much easier to use Div layout. W3C provides many elements to assist layout. Dd dt dl label

We usually use the <ul> <li> label, but the DD and DT labels are quite good, especially when releasing a program, the function module list or something can be used for layout.

<DL> </dl> <DT> </DT> <DD> </DD>

<DL> </dl> is used to create a common list. <DT> </DT> is used to create upper-layer projects in the list. <
DD> </DD> is used to create the lowest-level projects in the list. <DT> </DT> and <DD> <
/DD> must be placed between <DL> </dl>. You will understand the following example:

DL -- Define
List -- define a list
DT -- Define list title -- is used to generate the title of each list item in the definition list. You can repeatedly use the title to define multiple list items.

Dd -- Define list define -- used to generate the plain text fields of each list item in the definition list. Multiple plain text fields can be defined for repeated use. Dd is a brief description or solution of corresponding dt

Example:
<DL>
<DT> today
<DD> Today is yesterday.

<DT> tomorrow
<DD> tomorrow is today.
</Dl>

Example 2:
<HTML>
<! 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>

<Title> untitled document </title>
<Style type = "text/CSS">

<! --
Dt {
Float: left;
Width: 60px;

Margin: 0px;
Padding: 0px;
}
Dd {

Float: left;
Clear: none;
Width: 290px;

Margin: 0px;
Padding: 0px;
}
DL {
Width: 350px;

Font-size: 9pt;
Line-Height: 1.5em;

Position: relative;
Margin: 0px;
Padding: 0px;

Left: 15px;
}
. Red {
Color: # ff3300;
}

# Box {
Width: 500px;
Background-color: # f1f1f7;

}
# Box # Content {
Padding-top: 10px;

Padding-Right: 10px;
Padding-bottom: 10px;
Padding-left:
20px;
}
-->
</Style>
</Head>
<Body>

<Div id = "box">
<Div id = "content">
Src =/article/uploadfiles/200704/20070412091408274 .gif align = "Left"/>

<DL>
<DT> product name: </DT>

<DD> <strong> [Big One] </strong> benefits: <Span
Class = "red"> <em> 8.5 off </em> </span> </DD>

<DT> product introduction: </DT>

<DD> product name
Product Name product name ...... [<Span
Class = "red";> detailed introduction </span>] </DD>

<DT> store address: </DT>
<DD> product name </DD>

<DT> contact number: </DT>
<DD> 0000-12345678 87654321
</DD>
</Dl>
</Div>
</Div>
</Body>

Synchronized

Related Article

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.