CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 18th, 2004, 03:51 AM
dwightjelee's Avatar
dwightjelee dwightjelee is offline
Sockless.net
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Purmerend, the Netherlands
Posts: 33 dwightjelee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Question Override embedded CSS with linked CSS?

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.

Reply With Quote
  #2  
Old February 18th, 2004, 03:56 AM
jbot's Avatar
jbot jbot is offline
a rootin', tootin', shootin'
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Feb 2004
Location: location.href="hame"
Posts: 3,459 jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 8 h 7 m 36 sec
Reputation Power: 94
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

Reply With Quote
  #3  
Old February 18th, 2004, 04:03 AM
dwightjelee's Avatar
dwightjelee dwightjelee is offline
Sockless.net
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Purmerend, the Netherlands
Posts: 33 dwightjelee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Ok little confused now

I don't really get it anymore, should I put that in my CSS or in my HTML?

Pleaze advise

Reply With Quote
  #4  
Old February 18th, 2004, 04:03 AM
Winters Winters is offline
Bad Coder
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2003
Posts: 1,806 Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level)Winters User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 3 h 20 m 23 sec
Reputation Power: 186
Place the external CSS link below the inline CSS.

Reply With Quote
  #5  
Old February 18th, 2004, 04:06 AM
dwightjelee's Avatar
dwightjelee dwightjelee is offline
Sockless.net
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Purmerend, the Netherlands
Posts: 33 dwightjelee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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

Reply With Quote
  #6  
Old February 18th, 2004, 04:08 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Or try using the !important setting on your property within your css selector in your linked style-sheet.

Hope that helps,

-D

Reply With Quote
  #7  
Old February 18th, 2004, 04:10 AM
jbot's Avatar
jbot jbot is offline
a rootin', tootin', shootin'
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Feb 2004
Location: location.href="hame"
Posts: 3,459 jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level)jbot User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 8 h 7 m 36 sec
Reputation Power: 94
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.

Reply With Quote
  #8  
Old February 18th, 2004, 04:13 AM
dwightjelee's Avatar
dwightjelee dwightjelee is offline
Sockless.net
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Purmerend, the Netherlands
Posts: 33 dwightjelee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Talking

Thanks a lot man! It worked out just fine
I've been strugling for 2 days on this code

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Override embedded CSS with linked CSS?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway