"Todd Parker" <no@email> wrote:
Quote:
"Stan Brown" <the_stan_brown (AT) fastmail (DOT) fm> wrote:
In your style sheet:
td h3, th h3 { margin-top: 0 }
Thanks, but this affects *all* the <h3> elements inside the cell. Note that
in my example, there's a second <h3> element in the middle. I still want the
space above that <h3>, just not the unnecessary space at the top of the cell
(or the bottom, if I were to put an <h3> or other block element there).
I'm trying to find a way to avoid having to resort to separate styles for
top/middle/bottom elements just to work around this Mozilla quirk... |
The first H3 inside any cell can be selected by the following:
td h3:first-child, td h3:first-child {margin-top: 0;}
Not supported by IE, but as IE seems to be giving you the style you
want anyway (through either a bug or a different default value) that's
not a problem in this case.
In CSS3 there will be a last-child selector as well, but as that's
still some way off I wouldn't expect any browser support for the time
being.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>