Navigation bar, navigation bar Material
Set the highlight style in css of
- Float: left-use float to slide block elements to each other.
- Display: block-display the link as a block element so that the entire Link area can be clicked (not only text), but also the specified width.
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style type = "text/css">
Body {padding: 0; margin: 0 ;}
Ul {list-style-type: none ;}
A {text-decoration: none ;}
. Maincontent {padding: 0 px; margin-right: 10px; margin-left: 10px; background: #000 ;}
. Maincontent. nav {color: # fff; height: 30px; background: #000 ;}
. Maincontent. nav ul {margin: 0px; line-height: 30px; display: block ;}
. Maincontent. nav ul li {float: left; line-height: 30px ;}
. Maincontent. nav ul li a {color: # fff; padding: 0 30px; line-height: 30px; display: block; cursor: pointer ;}
. Maincontent. nav ul li a: hover {color: # F03; background: # fff ;}
</Style>
</Head>
<Body>
<Div class = "maincontent">
<Div class = "nav">
<Ul>
<Li> <a href = ""> homepage </a> </li>
<Li> <a h> Home page </a> </li>
<Li> <a> Home page </a> </li>
<Li> <a> Home page </a> </li>
<Li> <a> Home page </a> </li>
<Li> <a> Home page </a> </li>
</Ul>
</Div>
</Div>
</Body>
</Html>