Re: Transparent background color

Bjørn Sandvik wrote:
> 
> Our university has a stylesheet with a background color on links.
> I have links on a background picture, however, and would like to remove 
> this color.
> I have made a class for the links in question with background:transparent
> in a new stylesheet loaded after the university ones. 

> Both IE and Opera seems to
> interpret transparent as "keep the previous style", so the background color
> is preserved.

I had this problem and fixed it thus (in, e.g.,
http://richinstyle.com/style/okbrowser.css):

/* Opera hack */



TD.navigationcell, TD.sectionscell {background: #fff} 



TD.navigationcell, TD.sectionscell {background: transparent}


However, this is no good if you have a background image; I set the
colour of the background to the colour required for apparent
transparency.

Opera only has problems at http://richinstyle.com/free/colorizer.html,
where the background of the page changes according to a JavaScript, and
the table cell colour stays constant, which is somewhat unsightly (the
script appears not to work at all in Opera 4.01).

(Unfortunately this won't help you with an image)

However, Internet Explorer does not suffer from this bug so it is likely
that the problem is that your selectors are less specific - in other
words, :link following A:link will result in A:link winning thanks to
its greater specificity. Make sure the later specific is at least as
specific as the earlier one. This will 'fix' IE (which is not broken in
this respect); the probable reason that things are OK for Netscape is
that it is buggy and is accepting your selector.

-----------------------------------
Please visit http://RichInStyle.com. Featuring:
MySite: customizable styles.         AlwaysWork style 
Browser bug table covering all CSS2 with links to descriptions.
Lists of > 1000 browser bugs         Websafe Colorizer 
CSS2, CSS1 and HTML4 tutorials.      CSS masterclass 
CSS2 test suite: 5000++ tests and 300+ test pages.

Received on Thursday, 3 August 2000 08:39:43 UTC