The Navigation bar menu, which is shown in the image on the left. Below, we will expand how to make.
1, first, the production of a vertical Project menu, with <ul><li> tags to write the basic content, and then in the style sheet with margin and padding to remove the internal and external margins, with List-style attributes to remove the original bullets, insert their favorite bullets, the code is as follows:
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <title>Lists and navigation bars</title><styletype= "Text/css">ul{padding:0;margin:0;List-style:None; }Li{
Background:URL (symbolic address. png) no-repeat 0 50%;//This time must write background height:30px;Line-height:30px;Padding-left:30px; }</style></Head><Body><ul> <Li><a href = "#" >Project1</a></Li> <Li><a href = "#" >Project2</a></Li> <Li><a href = "#" >Project3</a></Li> <Li><a href = "#" >Project4</a></Li></ul></Body></HTML>
You can also set your favorite borders and background colors for your project at the same time:
li{ Background:url (%e9%a1%b9%e7%9b%ae%e7%ac%a6%e5%8f%b7.png) no-repeat 0 50%;//This time must write background height: 30px;line-height:30px; padding-left:30px; Display:block; width:70px; Background-color: #CCC; border:1px solid #666; }
At this point, you will find that the middle border line is thicker, you can solve the problem by removing the bottom border, and then adding the last item or the first item:
li{ border-bottom:0; } UL #last { border-bottom:1px solid #666; }
This time, the basic style of the vertical navigation bar has come out, of course, we also need:: hover,:focus,:selected state:
UL Li A:hover,ul li a:focus{ color: #000; Background-color: #960; }
This time, both the beautiful style and the flip effect of the vertical navigation menu is born ~ ~ ~
css--vertical Menu creation for list and navigation bar menus