Graphic Design Forum and Web Design Forum  

Go Back   Graphic Design Forum and Web Design Forum »Web Design Forum »CSS Forum

Notices

CSS Forum Cascading Style Sheets (CSS) and XHTML Forum


Reply
 
LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-10-2007, 10:14 PM
dannynosleeves's Avatar
currently on the run
 
Join Date: Jun 2007
Location: NC
Posts: 431
Default css navigation

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #2 (permalink)  
Old 08-10-2007, 10:51 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

li is a block-level element. I wouldn't use it at all in this case... but i suppose if you were to use display:inline; then that'd work.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #3 (permalink)  
Old 09-10-2007, 07:26 AM
PR Design's Avatar
CSS Wizardry
 
Join Date: May 2007
Location: Yorkshire, England
Posts: 2,165
Default

#home{
float:left;
display:inline;
}

Etc for each li.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #4 (permalink)  
Old 09-10-2007, 08:51 AM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #5 (permalink)  
Old 09-10-2007, 01:55 PM
dannynosleeves's Avatar
currently on the run
 
Join Date: Jun 2007
Location: NC
Posts: 431
Default

Quote:
Originally Posted by LeadMagnet View Post
li is a block-level element. I wouldn't use it at all in this case... but i suppose if you were to use display:inline; then that'd work.
Im already using display: inline
__________________
Outlaw Design Blog - Better Than Sex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #6 (permalink)  
Old 09-10-2007, 01:56 PM
dannynosleeves's Avatar
currently on the run
 
Join Date: Jun 2007
Location: NC
Posts: 431
Default

Quote:

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.
I agree, but each button image is a different width. How could I make that work?
__________________
Outlaw Design Blog - Better Than Sex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #7 (permalink)  
Old 09-10-2007, 02:20 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #8 (permalink)  
Old 09-10-2007, 03:14 PM
dannynosleeves's Avatar
currently on the run
 
Join Date: Jun 2007
Location: NC
Posts: 431
Default

Quote:
Originally Posted by LeadMagnet View Post
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.
I dont have it uploaded anywhere yet. I'll play around with your suggestions later today and upload it.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #9 (permalink)  
Old 09-10-2007, 03:25 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

ah i see. That makes sense.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #10 (permalink)  
Old 09-10-2007, 03:44 PM
PR Design's Avatar
CSS Wizardry
 
Join Date: May 2007
Location: Yorkshire, England
Posts: 2,165
Default

Quote:
Originally Posted by LeadMagnet View Post
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.
I was just working on the situation at hand, as opposed to rewriting the code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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.



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC5