Topic: CSS Override Stylesheets Pages that link to <a href="https://ozoneasylum.com/backlink?for=11144" title="Pages that link to Topic: CSS Override Stylesheets" rel="nofollow" >Topic: CSS Override Stylesheets\

 
Author Thread
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

IP logged posted posted 02-09-2004 16:53 Edit Quote

Howdy,
Do styelesheets support overriding previous defined elements? So if I have a base stylesheet, then I copy from the base stylesheet (for example) a class called "mytable" and create new stylesheet and add here. So we have: stylesheet_base and stylesheet_override
Now, in my HTML source I have to Links to external style sheets like this:

<link href="/style/stylesheet_base.css" rel="stylesheet" type="text/css" />
<link href="/style/stylesheet_override.css" rel="stylesheet" type="text/css" />

Wouldn't the properties assigned for "mytable" in the override stylesheet take effect in place of the base stylesheet?
I'm using IE 6+ and am not sure if I am doing something wrong or if IE does not support this sort of thing.

Karl


HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

IP logged posted posted 02-09-2004 17:59 Edit Quote

Yea, if it's the same (or equivalent) selector in both files, the selector in the stylesheet_override should will indeed override the selector in stylesheet_base. However, it also has to do with the specificity. For example, if the selector in stylesheet_base looks like

code:
table#mytable


and the selector in stylesheet_override looks like

code:
#mytable

the second selector will not override the first one since the first one has a higher specificity (see http://www.w3.org/TR/REC-CSS2/cascade.html#specificity )
I don't know if IE6 has problems with this, post the URL if the problem still remains.




Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu