Previous Message
Next Message

Weird inheritance issue?

Sent by Jeff Chastain on 21 September 2005 18:06

Well, you learn something new every day.  I knew an id had preference over a class, I just assumed
since I specified the class which was nested inside, that I would be good.  Makes the style sheet a
bit uglier, but that works.

-- Jeff

 From: "Tom Livingston" [EMAIL-REMOVED]>
Sent: Wednesday, September 21, 2005 12:33 PM
Subject: Re: [css-d] Weird inheritance issue? 

On Wed, 21 Sep 2005 13:23:57 -0400, Jeff Chastain 

> When I do this, all three blocks still have a red border. The weird 
> thing is that if I change the 'class="photoBlock'" to 'id="photoBlock"' 
> and update the styles accordingly,
> I have red and blue blocks. Why does this not work for a class, but 
> will work for an id (which I can't use as there are multiple 
> 'photoBlock's)?

IIRC, ID has higher specifity than class. So it rules. Did you try:

#container .photoBlock .crWrapper { border: 1px solid #00f; }

Tom Livingston
Senior Multimedia Artist
Media Logic

Using Opera's revolutionary e-mail client:

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Possibly related: