Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 08-24-2007, 11:09 AM Padding
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
I've tried changing the padding in the #nav div navbar and found that the right and left padding can be modified using the following declaration:

#nav ul li a{
padding: 0px 30px;
margin: 0px;
text-decoration: none;
font-weight: bold;
color: #FFFFFF;
}


The top and bottom padding, however, can only be modified in the higher level declaration:

#nav {
padding: 2px 0px;
margin: 0px;
background-image:url(images/navbar_fade2.JPG);
background-repeat:repeat-x;
font-size: 70%;
text-align: center;
color: #FFFFFF;
zoom:1;
}

Why can't I modify all four paddings in the first declaration?

http://www.diamondpackaging.com/green/diamond8c.htm
http://www.diamondpackaging.com/green/diamond8c.css
wilbury is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-24-2007, 11:34 AM Re: Padding
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Not true. You're comparing apples and oranges here.
#nav refers to the DIV and applies padding to IT.

#nav ul li a - applies padding to the LINK that is inside the list item, inside the UL, which is inside the #nav div.

Adjusting padding on the LINK <a> inside the list item is done as padding: 2px 30px.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-24-2007, 12:40 PM Re: Padding
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
That's what I thought. But for some reason using the code below does not seem to do what I want it to do - that is create a little more breathing room around the links in the #nav. Rather, when using this method the #nav "compresses" and doesn't utilize the greater height (20px) of the navbar_fade2.JPG background image.

#nav {
padding: 0px;
margin: 0px;
background-image:url(images/navbar_fade2.JPG);
background-repeat:repeat-x;
font-size: 70%;
text-align: center;
color: #FFFFFF;
zoom:1;
}


#nav ul li a{
padding: 2px 30px;
margin: 0px;
text-decoration: none;
font-weight: bold;
color: #FFFFFF;
}
wilbury is offline
Reply With Quote
View Public Profile
 
Old 08-24-2007, 12:53 PM Re: Padding
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
give #nav a height equal to the height of your bg image.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-24-2007, 02:34 PM Re: Padding
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
I gave that a try but it didn't seem to do the trick.

For some reason, adding top and bottom padding to the #nav div (and not #nav ul li a) seems to be the only way to get it to appear the way I want. It's ok that this workaround solves a problem but I get the feeling I'm missing something.

Thanks,
Wilbury
wilbury is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Padding
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55160 seconds with 12 queries