...

View Full Version : Opposite Selector +



Sammy12
07-21-2011, 02:58 AM
http://i1114.photobucket.com/albums/k535/auroralight1/Untitled-25.png

I'm using a little padding to space the tab next to the selected tab (white), since I'm using a width on the <a> to give it a more "equal look". So I'm using + to select the next tab in order to push it over to the right (by 5 px). However, if a tab other than the first is selected, the tab to the left also needs to be pushed. My question is what is the selector to choose the tag before? I tried :before but it didn't seem to have an effect. My question really isn't about an alternate solution, I'm more interested in the selector to use.

- thanks



#mastHead .bin,
#mastHead .bin ul.nav,
#mastHead .bin ul.nav li,
#mastHead .bin ul.nav li a {
height: 28px;
}

#mastHead .bin ul.nav {
font-size: 13px;
}

#mastHead .bin ul.nav li a {
color: #EEE;
font-weight: bold;
line-height: 28px;
width: 80px;
text-align: center;
}

#mastHead .bin ul.nav li.selected + li a {
padding-left: 5px;
padding-right: 1px;
}

djh101
07-21-2011, 04:27 AM
http://www.w3schools.com/cssref/css_selectors.asp
Enjoy.

Lerura
07-21-2011, 04:31 AM
unfortunately there is not yet an opposite to +

:before is not a selector, it is a pseudo-element.

It is used when you want to add content before the original content of the specified element.
e.g.

<style>
div:before {content: "Mega"}
</style>
<div>bomb</div>will act as if you have written
<div>Megabomb</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum