[Wylug-help] Mozilla vs IE CSS differences

Smylers Smylers at stripey.com
Fri Dec 15 14:36:00 GMT 2006


Dave Hassett writes:

> There are some generic problems with the CSS too I think. You have a
> missing semi-colon on the font line (but I'm not sure whether this
> would have affected things or not).

Well spotted!  Gary had:

  font-family: arial, "sans serif", "new century schoolbook"
  border: 1px;

The line-break is irrelevant, so "border:" and "1px" would be treated as
additional typefaces to try if the preceeding ones aren't found.  It
definitely wouldn't set the border, so yes, this does have an effect!

> You need a comma between the CSS selectors, and the `#dman` bit needs
> repeating too. i.e. "#dman tr, #dman td" rather than just "#dman tr
> td".

That isn't true.  Both are valid syntax; they do different things.  What
Gary had:

  #dman tr td

means to apply the following rules to any <td> which is descended from a
<tr> which is descended from an element with id="dman".

Your alternative:

  #dman tr, #dman td

means to apply the rules both to any <td> which is descended from an
element with id="dman", and also to any <tr> which is descended from
such an elment.

In this particular case it may not make any difference (and in practice
<td>-s are always going to be descended from <tr>-s, so that isn't
adding anything), but the syntax Gary had is most definitely not a
"generic problem" and in other circumstances is quite useful.

Cheers.

Smylers



More information about the Wylug-help mailing list