|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi can anyone tell me if I can override embedded CSS with a linked stylesheet?
Here is what I want to change: Code:
<col width="40%" style="background-color:#EEEEEE;text-align:left;"> I want to change the background-color without changing anything in the above mentioned code, this means I want to change it with an extern stylesheet. ![]() Last edited by dwightjelee : February 18th, 2004 at 03:55 AM. |
|
#2
|
||||
|
||||
|
you want to use js, not css for this.
basically, call a js function like this one: function chgCss(objId) { document.getElementById(objId).style.backgroundColor = "#333" ; } nice and easy, m8 |
|
#3
|
||||
|
||||
|
Ok little confused now
I don't really get it anymore, should I put that in my CSS or in my HTML? Pleaze advise ![]() |
|
#4
|
|||
|
|||
|
Place the external CSS link below the inline CSS.
|
|
#5
|
||||
|
||||
|
Ehm.... I forgot to say that I can't change anything in my HTML page, I don't have permission for this.
The page is been requested from a company's server, this company want me to change the layout. But the only thing I have permission to change is the extern CSS file If I would have permission to change the HTML page I would have been done already ![]() |
|
#6
|
|||
|
|||
|
Or try using the !important setting on your property within your css selector in your linked style-sheet.
Hope that helps, -D |
|
#7
|
||||
|
||||
|
inline css always overrides external stylesheets. basically, given the the html you've shown and that you cannot change it, you're not gonna be able to change the styles of specific elements, only generically.
in an external stylesheet, you can write: col{background-color: #333 !important} but that would change all elements of that type, not a specific one. basically, you'll need access to the html to make any proper changes. btw: never use inline or head based styles. always use class names linked to external stylesheets. that way your site is more easily configured. |
|
#8
|
||||
|
||||
|
Thanks a lot man! It worked out just fine
I've been strugling for 2 days on this code ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Override embedded CSS with linked CSS? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|