CSS questions

Thomas Dowling tdowling at ohiolink.edu
Thu Feb 5 17:48:50 EST 1998


-----Original Message-----
From: DEANNE LUCK <LUCKDL at APSU01.APSU.EDU>
To: Multiple recipients of list <web4lib at library.berkeley.edu>
Date: Thursday, February 05, 1998 5:17 PM
Subject: CSS questions


>I've been experimenting with Cascading Style Sheets for some new pages
>and because I just want to keep up!  I've been using the WDG CSS Guide,
>but I still have a few questions.
>
>Do I really have to include a background element everytime I change a
>text color for <H1>, or whatever?  Why, when the background is specified
>in <BODY>?

The CSS checker at WDG is a great tool, but IMO gets a little too concerned
with the possibility that a user would have a very funky personal
stylesheet.  For instance, I could point my copy of MSIE 4 at a personal
stylesheet that included something like:

  H1 {background-color: orange; color: blue}

If your stylesheet simply includes:

  H1 {color: orange}

The effect in my browser is [your] orange text on [my] orange background,
which is usually considered suboptimal for communication purposes :-)  If I
recall the order of the cascade correctly, my H1 background-color setting
also takes precedence over your BODY background-color setting.

In practice, of course, this is an uncommon situation, but could crop up.

>
>How do I get the First Letter psuedo-element (as referenced in
>http://www.htmlhelp.com/reference/css/structure.html#pseudo) to
>work with my other <P> elements?  I copied the line straight from
>the example and stuck in it every position I could think of - it either
>did nothing or wiped out all my other <P> formatting.  I'm using IE4.0
>for testing if that makes a difference.

To my knowledge, the mainstream browsers are not yet supporting P:first-line
or P:first-letter.  Just today, though, I saw what we might politely call as
first-letter kludge composed with a SPAN element:

<p><span style="width: .75em; float: left; text-align: center; font-size:
xx-large">H</span>ello and welcome to my paragraph...

By the way, this looks like it's more complicated than it needs  to be:

<STYLE TYPE="text/css">
<!-- @import url(http://library.apsu.edu/dix/test.css); -->
</STYLE>

I'd go with <LINK REL="STYLESHEET" HREF=...>.  I believe only MSIE4
currently support @import (among the mainstream browsers).


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu




More information about the Web4lib mailing list