|
May 12, 2009 05:09:50
Posted By Doteasy
|
|
This menu:
To create the above menu, we will use CSS to style our basic list menu: 1. Remove all the default list styling. ol, ul { 2. Set the width and margin of the menu. #mainmenu { Setting the width prevents the menu from wrapping when the user shrinks the browser window. 3. Set the list items to display as blocks. We will also give them a width and float them to the left so they will be displayed to the right of the preceding item. We will also give them a margin border. #mainmenu li { 4. Change the a element to block-level elements. We will also add some formatting styles and remove the underline with text-decoration: none. #mainmenu a { 5. Finally, we will change the hover state of the links so that they highlight when a user points to them. #mainmenu a:hover {
The Full CSS Code So, to achieve the horizontal menu, you will add the following lines to your CSS code. The below example is for an internal stylesheet, if you are using an external stylesheet, simply add the lines between <style type="text/css"> and </style> to your CSS file. <head>
>> Stay tuned as next time, we will be creating a vertical menu. |





