CSS: 'BODY' not doing anything

Luc Grondin grondin.luc at uqam.ca
Mon Jul 20 11:53:44 EDT 1998


Hello

I am experimenting with style sheets and something does not do what I think
it should.

I would like to define the text and background colours so they can apply as
default to the entire HTML document (similarly as it is done with HTML 3.2:
 <BODY TEXT="#000099" BGCOLOR="#CCCCCC"> for instance).  According to the
W3C "Recommendation" ( http://www.w3c.org/TR/REC-CSS1 ), section 1.3,
setting these properties with the BODY element should do just that.

This is what I have done, using a linked external style sheet :

  8<-------------------

<STYLE TYPE="text/css">

BODY { background-color: #FFFFCC ; color: #000080  ; font-family: sans-serif }

/* Éléments d'hyperliens */
A:link { text-decoration: none; color: #666666; font-weight: bold }
A:visited { text-decoration: none; color: #999999; font-weight: bold }
A:active { text-decoration: none; color: #FF0000; font-weight: bold }

/* Éléments d'entêtes */
H1 { font-size: large; font-style: normal; font-weight: normal }
H2 { font-size: medium; font-style: normal; font-weight: bold }
H3 { font-size: small; font-style: italic; font-weight: bold }
H4 { font-size: small; font-style: italic; font-weight: normal }
H5 { font-size: small; font-style: normal; font-weight: normal;
margin-left: 2em }

</STYLE>

  8<-------------------

With both Netscape and IE, the styles for H's and A's are properly
displayed, but properties defined in BODY are ignored and displayed as set
on the browser's default. In the HTML file, no colours are defined (I put a
simple <BODY> ... </BODY>).  

Another strange thing is that if I remove completely the BODY element from
the style sheet, the 'A:link' element becomes ignored, while the
'A:visited' still applies correctly, as well as the other elements.  If I
add 'BODY { }', it works again.

What do I do wrong ?

Thanks in advance



mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
               Luc Grondin
         Bibliothecaire/Librarian
  Services informatises des bibliotheques
      Universite du Quebec a Montreal
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm



More information about the Web4lib mailing list