9.1 dl, DT, and DD tags in html

Source: Internet
Author: User
Tags php tutorial

In this chapter, we will build a more complex drop-down menu based on the previous two chapters. When the content of the site is relatively rich, the structure is more complex, the first level of navigation menu is often not enough, then need a multilevel menu to achieve hierarchical structure. In fact, anyone using a computer will not be unfamiliar with the dropdown menu, and almost all the software will provide the user with an operational command interface through the menu.

On the early web site, making multi-level menus is a hassle and difficult to maintain. However, in recent years, due to the constant popularity of CSS, the use of CSS-made menus can be very convenient for the site to provide clear navigation support.

In this case, a drop-down menu is created. Figure 9.1 shows the effect that the submenu does not open when the mouse leaves the menu, and Figure 1 shows the effect of a submenu open.


Figure 1 Effects when a submenu is displayed

A set of HTML tags-DL,DT and DD are introduced here. This set of tags is not as common as the UL and Li tags, but it is very appropriate to define the structure in this case.

DL, DT, DD This set of tags and UL, Li very similar, also used in the list structure. The DL is referred to as the "definition list" (definitionlist), where the use of the method is equivalent to UL;DT and DD respectively referred to as "definition title" and "Definition description" (defined description), They are equivalent to Li on the way they are used. For example, there is the following HTML code:

FoldingExpandxml/html Codecopy content to clipboard
  1. < Body >   
  2. < DL >   
  3. <DT> Web Learning Web page making tutorial </DT >
  4. <dd>HTML tutorial </dd>
  5. <dd>CSS Tutorial </dd>   
  6. <dd>php tutorial </dd>
  7. <DT> Web Learning Network tool Tutorial </dt>
  8. <dd>Zend Studio</dd >
  9. <dd>Dreamweaver</ DD >
  10. <dd>Visual Studio</dd> /c8>
  11. <DT> Web Learning Network plane tutorial </dt>   
  12. <dd>PhotoShop</ DD >
  13. <dd>CorelDraw</dd >
  14. <dd>Fireworks</dd>   
  15. </ DL >   
  16. </ Body >   

The effect in the browser is shown in 1. You can see that the DL is equivalent to U1,DT and DD equivalent to Li. The difference is that DT and DD are treated differently. If you want the menu to have a submenu, you can define the menu item text of the main menu as DT, and the menu item under the menu is defined as DD.


Figure 1 Using the definition list

Click to download the 8th to 17th CSS Tutorial resource to return to the tutorial list of CSS Tutorial layout

Editor: Web Learning Network
This address: http://www.lodidance.com/css/jc/728.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.