Use UL and Li for horizontal navigation

Source: Internet
Author: User
Use UL and Li for horizontal navigation

1e.generate the site.css file (Note: You must set the file encoding format to UTF-8, otherwise IE6 may contain garbled characters)

/* Ul Li displays the UL style */DIV in the DIV with all classes as menu in a horizontal bar. menu ul {list-style: none;/* remove the symbol before ul */margin: 0px;/* distance from the external element is 0 */padding: 0px; /* The distance from the internal element is 0 */width: auto; /* adjust the width according to the element content */}/* Li style */DIV in UL of all Div whose class is menu. menu ul Li {float: Left;/* drift to left, change the vertical bar to the horizontal bar */}/* All the class as the style (including unclicked and clicked styles) in the UL of the menu Div */Div. menu ul Li a, Div. menu ul Li A: visited {background-color: # effecc71;/* Background Color */Border: 1px # 4e667d solid;/* border */color: # dde4ec;/* text color */display: block;/* this element is displayed as a block-level element, this element carries a line break */line-Height: 1.35em;/* line height */padding: 4px 20px;/* internal padding distance */Text-Decoration: none; /* do not show hyperlink underline */white-space: nowrap;/* for blank spaces in the text, the text will not wrap, and the text will continue on the same line, until the <br> label is encountered. * //}/* All the class is the style in UL In the DIV of menu (move the mouse to the style in the element) */Div. menu ul Li A: hover {background-color: # bfcbd6;/* Background Color */color: #465c71;/* text color */Text-Decoration: none; /* do not show hyperlink underline */}/* all class is menu. In the DIV, the style in UL (the style when you click the element) */Div. menu ul Li A: active {background-color: #465c71;/* Background Color */color: # cfdbe6;/* text color */Text-Decoration: none; /* do not show hyperlink underscores */}

2. reference the above CSS style file on the foreground

<link href="Styles/Site.css" rel="stylesheet" type="text/css" />

3. Foreground Data

<Div class = "menu"> <ul> <li> <a href = "javascript: void (0 ); "> homepage </a> </LI> <li> <a href =" javascript: void (0 ); "> work log </a> </LI> <li> <a href =" javascript: void (0 ); "> device running records </a> </LI> <li> <a href =" javascript: void (0 ); "> others </a> </LI> </ul> </div>
Copy code

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.