![]() |
|
|||||||
| Notices |
| CSS Forum Cascading Style Sheets (CSS) and XHTML Forum |
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
||||
|
So i always have this problem and always forget the solution.
Im using an unordered list for a horizontal navigation. But I cant get the images to displat side-by-side. ![]() Here is the code Code:
/***********************************NAVIGATION***/
ul#nav-main {
position: absolute;
top:137px;
left:220px;
width:600px;
height:52px;
background-color:#99FF33;
margin: 0;
}
ul#nav-main li {
display:inline;
line-height:52px;
}
li#home a {
display:block;
width:115px;
background-image: url(../images/images/home.png);
text-indent:-99999px;
}
li#about a {
display:block;
width:99px;
background-image:url(../images/images/about.png);
text-indent:-99999px;
}
li#calendar a {
display:block;
width:145px;
background-image:url(../images/images/calendar.png);
text-indent:-99999px;
}
li#forms a {
display:block;
width:106px;
background-image:url(../images/images/forms.png);
text-indent:-99999px;
}
li#contact a {
display:block;
width:135px;
background-image:url(../images/images/calendar.png);
text-indent:-99999px;
}
Code:
<!--BRANDING-->
<div id="branding">
<h1>Off the Walls</h1>
<blockquote>North Alabams largest indoor entertainment facility.</blockquote>
<!--NAVIGATION-->
<h2>Site Navigation</h2>
<ul id="nav-main">
<li id="home"><a href="#" title="Home">home</a></li>
<li id="about"><a href="#" title="About">about</a></li>
<li id="calendar"><a href="#" title="Calendar">calendar</a></li>
<li id="forms"><a href="#" title="Forms">forms</a></li>
<li id="contact"><a href="#" title="Contact">contact</a></li>
</ul>
</div>
<!--end of branding div-->
__________________
Outlaw Design Blog - Better Than Sex |
|
||||
|
#home{
float:left; display:inline; } Etc for each li.
__________________
Standards Compliant Web Consulting and Development | Labs - Free Snippets and Codes | CSS Wizardry |
|
||||
|
Well done PR Design. You win today's redundancy award.
![]() You're fired. And while we're at it, it's messy to use separate css for each li. It's better to either use 1 class for all of them or else target all li tags, or even just give the ul tag an id and target it's li children.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point. |
|
||||
|
Im already using display: inline
__________________
Outlaw Design Blog - Better Than Sex |
|
||||
|
Quote:
__________________
Outlaw Design Blog - Better Than Sex |
|
||||
|
all your A tags in that list have display:block; set which seems to be throwing things off (at least in firefox anyway).
Have you got this uploaded somewhere? Would be much easier to find the problem if we could see it all together in 1 place. Also, what's this about: text-indent:-99999px; as for the images being a different width, if you really needed to specify it, then you would probably just use an id tag selector for that. But for re-using the same code on similar tags, class is better.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point. |
|
||||
|
Quote:
The text indent is a trick to keep the site accessible. Whatever has a -99999 indent ment means it cant be seen in a normal browser window, but will still show up correctly without styles.
__________________
Outlaw Design Blog - Better Than Sex |
|
||||
|
Quote:
__________________
Standards Compliant Web Consulting and Development | Labs - Free Snippets and Codes | CSS Wizardry |
![]() |
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| navigation | cre8 | General Web Design Forum | 12 | 09-05-2008 04:58 PM |
| Nice Navigation | James Jones | Flash Forum | 1 | 07-04-2008 06:05 PM |
| Great Portfolio Navigation...... | Toon | General Web Design Forum | 5 | 23-03-2008 09:41 AM |
| Free CSS Navigation Menus | Graphic Design Links | Graphic Design Links | 0 | 31-12-2007 08:00 PM |
| Help with navigation layout please | -jordan- | Graphic Design and Web Design Help | 14 | 09-12-2007 05:28 PM |
| All times are GMT. The time now is 04:15 AM. |
