css sibling combinator q?
- Started
- Last post
- 4 Responses
- airey
alrighty, any css whizo's here?
i'm looking at using come css combinators (.product + p) in my css and i've no idea about it's support across modern browsers nor it's capabilities.
just stumbled across andy clarke's chapter in 'web standards creativity' and thought it looked awesome. but clueless i am.
- JamesBoynton0
Is that to target p tags purely in .product?
If so i use that all the time and have never had any problems, maybe give it a go, upload it and hit http://browsershots.org/ to see if it works.
- airey0
that was simply an example.
i've got a selector for small images inside a wrapping div. i want a 15px gap beneath the first small image but not beneath the 2nd so i'm using a code similar to:
.smallImageContainer .smallImage {
background-color: #FFFFFF;
padding: 0px;
float: left;
height: 60px;
width: 72px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 15px;
margin-left: 0px;
}
.smallImageContainer .smallImage + .smallImage {
margin-bottom: 0px;this works in safari + firefox on mac but am working through a bit more before flicking over to XP and trilaing it there. just looking for info from anyone with actual experience.
- fugged0
you're kinda out of luck with IE6. I would have suggested using the pseudo selector "first-child", but that isn't supported. for a list of selectors and browser compatibilities, check out this site : http://www.quirksmode.org/css/co…
You'll probably have to explicitly assign the class with the extra margin to the first element in your html.