I need to say my h1 has 1.8em bottom margin. But if it has #date id directly after the h1 has bottom margin zero? And instead the #date has the bottom margin of 1.8em? I'm strongly guessing a big fat no but thought I'd ask - maybe some css3 thing.
| SitePoint Sponsor |
I need to say my h1 has 1.8em bottom margin. But if it has #date id directly after the h1 has bottom margin zero? And instead the #date has the bottom margin of 1.8em? I'm strongly guessing a big fat no but thought I'd ask - maybe some css3 thing.


An easy solution might be to target a #date element that follows an h1 with
h1 + #date {}
and then give the date element a bottom margin and a negative top margin to pull it up.


I'd do it the way Ralph suggests because as yet there is no parent selector in CSS.
www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge
Ya thats what i figured. Ok thanks guys.

Bookmarks