![]() |
Padding without moving border?
Hey,
I have a navigation using LIs. I added a border to the right to simulate a spacer for each link. What I'm trying to do is add padding to the top to bring the text down some becasue it's too high. But when I do that, the padding also moves the border. Is there a way around this? HTML Code:
<div id="nav">Code:
#nav ulCode:
#featuresNav ul li .activeBasically I just want the background and font color to change if I set the LI element to "active". thanks :) |
Increase the line-height on the a-element instead of using padding-top. Besides that, there's a mistake in your active-state declaration. Remove the space between the li-element and the class, so that it looks like this: #featuresNav ul li.active
|
#featuresNav ul li .active
to #featuresNav ul li.active is not always a mistake. The second states I want the li that has a class of active the first states that you want an li that has or contains the class active. So if you were to put the class on the li tag you would want the li.active if you were going to put it on the a tag you would want the li .active. Second line height is one of those things you try to avoid as it is not 100% implemented in all the browsers. So you may get funky results when its combined with different things. |
thanks guys but its not working.
I did: Code:
#nav ul li.activeCode:
<div id="nav"> |
It's because the "weight" is not greater... or it isn't defined more specifically ? For lack of better description.
Try this : Code:
div#nav ul li.activeThis SHOULD work, and just a note, you can use ul as the "nav" container itself, no need for an extra wrapping div :) Edit : Re-read your original post, might have to add an "a" at the end of that ^ |
thanks it works. What if I wanted to add padding to the top without the border to the right moving? I tried doing a couple of different things but it doesn't seem to work.
edit: nvm I just saw the 2nd post. works :) |
| All times are GMT. The time now is 09:31 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0