
Originally Posted by
Minos
Why not just replace them with divs?
Code:
<div id="nav">
<div><a href="#" id="about_us">Home</a></div>
<div><a href="#" id="process">Archive</a></div>
</div>
.
putting them within divs is not using correct coding... navigational menus are best defined as unordered lists, then using CSS styles to remove the bullets, and apply the appropriate background margins/padding to fit with the background image wanted.
I never said he was tied to it :P. And while removing the padding from the list is a solution, I don't quite see the point (in this case). It's the same effect as <b></b> a word and then using css to remove the bold.
Navigation / Menus are lists (ul/ol), not blocks of code (div)
On a side note... <b></b> tags should be used only for a "presentational" bolding effect. If you actually want that word/phrase to be emphasized or pronounced, the correct code is <strong></strong>
same goes for <i></i> and <em></em>
Medyman was about 80% correct in his styling.
You need to 2 different styles here to do this correctly.
You need to first apply a styling to the <ul> to rid the list of bullets, and you could use the float property if you are coding the menu to be as its own column .... eg... dont waste an extra <div> to declare a left/right column.
you would then need to apply a style to the list items ( <li> ) to get rid of the default margin/padding then apply margins/padding for a background image (ps they should all be the same size)
Code:
ul#nav {
float:left;
list-style-type: none;
}
ul#nav li {
margins: 0;
padding: 5px 0 5px 20px; /* 5top 0right 5bottom 20left */
}
ul#nav li a#about_us {
background: transparent url('/images/buttons/about_us.jpg') no-repeat top left;
}
ul#nav li a#about_us:hover {
background: transparent url('/images/buttons/about_us_over.jpg') no-repeat top left;
}
ul#nav li a#process {
background: transparent url('/images/buttons/process.jpg') no-repeat top left;
}
ul#nav li a#process:hover {
background: transparent url('/images/buttons/process_over.jpg') no-repeat top left;
}
Bookmarks