[WEB4LIB] IE CSS behavior

Thomas Dowling tdowling at ohiolink.edu
Thu Jan 27 14:58:10 EST 2000


>From the CSS1 spec:

5.3.1    'color' ... This property describes the *text color* of an
element

(Emphasis added)  I suspect there's at least room for argument about
whether the border around an image in a hypertext link counts as text.

Try this:

a:link     { color: #155424 }
a:link img {border: thin solid #155424}
a:visited  { color: #9f0e00 }
a:visited img {border: thin solid #9f0e00}
a:active   { color: #000000 }
a:active img {border: thin solid #000000}



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


----- Original Message -----
From: "Peter C. Gorman" <pgorman at library.wisc.edu>
To: "Multiple recipients of list" <web4lib at webjunction.org>
Sent: Thursday, January 27, 2000 2:11 PM
Subject: [WEB4LIB] IE CSS behavior


> Hello,
>
> I've run into some odd behavior with IE's handling of CSS, and I
> wonder if anyone's found a workaround. The problem is that IE (4.5
> Mac, 5.01 NT) does not use the CSS-defined link color for anchors
> around images. In the following, the textual parts of the links are
> colored correctly, but the image border is the browser's default link
> color. Putting the color in a style attribute in the opening tag does
> not help. Any ideas? I know I could probably force the color with the
> markup, but I really want to keep this in CSS, where it belongs.
>
> Netscape 4.x has no problem with this - it's the first case I've seen
> of Netscape doing something in CSS better than IE does.
>
>
> <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>title</title>
> <style type="text/css">
> <!--
> a:link     { color: #155424 }
> a:visited  { color: #9f0e00 }
> a:active   { color: #000000 }
> -->
> </style>
> </head>
>
> <body>
>
> <a href="foo"><img src="myimage.jpg" alt="image"> with some text</a><br>
> <a href="foo">some more text</a>
>
> </body>
> </html>
>
> Thanks for your help,
> _______________________________
> Peter C. Gorman
> Senior Technology Librarian
> University of Wisconsin-Madison
> Library Technology Group
> pgorman at library.wisc.edu
> (608) 265-5291
>
> What's the difference between fiddle players and government bonds?
> Government bonds eventually mature and earn money.
>



More information about the Web4lib mailing list