Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 03-14-2011, 03:44 PM   #1
Silver Member
 
notarypublic's Avatar
 
Join Date: Feb 2011
Posts: 191
Default Increasing spacing in CSS drop-down menu bar

Some of the feedback for my current site is that there could be more spacing between the links in the navigation bar. It's constructed as an unordered list and uses CSS to hide and hover the drop-down menu items when the mouse moves over them.

I can change the width of the top link using a class, like

Code:
.navBarTitle {
width: 5 em;
}

------

<li class = "navBarTitle"><a href = "#">Link</a></li>
But by using a class this way they all end up the same length. I could use id's for each link, but that seems inefficient. Is there a way to append a set length of pixels at the end of the <li> before closing the </li> tag and starting the next one? I've tried setting different margins, using padding, spans.. No luck.
__________________
http://www.joshualoves.com/
notarypublic is offline   Reply With Quote


Old 03-14-2011, 07:49 PM   #2
Gold Member
 
Join Date: Feb 2011
Location: Australia
Posts: 369
Default

I think the navigation looks good. but if you want you can cheat by putting just a couple spaces at the end using "&nbsp;" of course it's not best practice.
DHDdirect is offline   Reply With Quote
Old 03-14-2011, 08:03 PM   #3
Silver Member
 
notarypublic's Avatar
 
Join Date: Feb 2011
Posts: 191
Default

Quote:
Originally Posted by DHDdirect View Post
I think the navigation looks good. but if you want you can cheat by putting just a couple spaces at the end using "&nbsp;" of course it's not best practice.
I just uploaded a new version of the site (tiled background, different font color, some other minor fixes) and fixed the spacing issue by changing the padding value for the links inside of the <li> tags.

HTML Code:
#nav ul li a {
padding-right: 2em;
}

-------------

<ul>
  <li><a href = "#">A link</a></li>
</ul>
This causes a slight bump on the right hand side of the links to increase the word spacing. As an added plus, this makes the boxes for the drop-down menu slightly larger as well.
__________________
http://www.joshualoves.com/

Last edited by notarypublic; 03-14-2011 at 08:06 PM.
notarypublic is offline   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



All times are GMT. The time now is 06:48 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.