[thelist] css woes - ie 6 ?

James Aylard webmaster at equilon-mrc.com
Wed Sep 26 11:28:08 CDT 2001


Glenn,

> You have a number of missing semi-colons in your stylesheet. You also
> had the following:
> a.reddish:hover {
> It should be:
> .reddish a:hover {

    Actually, both forms are correct; which you use depends on what you are
trying to accomplish. The first one (a.reddish:hover) will only apply the
styling to an <a> element with the classname "reddish" while it is in its
hover state. The second one will apply only to <a> elements, in the hover
state, that are direct descendants of an element with the classname
"reddish". So, the first one would apply in the following example:

<a class="reddish" href="link.html">link</a>

    The second would apply in this example:

<div class="reddish"><a href="link.html">link</a>

    You are right about the missing semicolons. Semicolons are required
following every property declaration, except that they are optional
following the *last* property declaration for a given selector, e.g., this
is correct:

a {
  color: #ffff00 ;
  font-family: Wazoo ;
  font-size: 20px
  }

    However, I strongly recommend placing them after *every* property
declaration, since later editing might mean that the last property is no
longer the last -- and it's easier to be consistent by using them always.

James Aylard





More information about the thelist mailing list