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 March 9th, 2004, 07:56 PM
Fahrvergnuugen Fahrvergnuugen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Galway, NY
Posts: 183 Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level)Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 22 h 41 m 31 sec
Reputation Power: 8
Send a message via AIM to Fahrvergnuugen
CSS Question: Is this legit / supported / compliant?

I'm wondering if duplicate / overriding directives are allowed in the CSS Spec.
Here's an example:
Code:
<div style="background-color: black; background-color: white">


will the second call to background-color override the first and be drawn as white?

it may sound stupid, but i'm writing a PHP class that outputs CSS and I don't want to have to do pattern matching to make sure that the user inputted tag isn't already set. I want to just append it.
__________________
-Paul Wieland_____________
http://www.sickdimension.com

Reply With Quote
  #2  
Old March 9th, 2004, 08:27 PM
Alnitak Alnitak is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 Alnitak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i know it's not legit and i think it could cause problems bij some browsers rejecting the css

Reply With Quote
  #3  
Old March 9th, 2004, 08:35 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,461 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 15 h 14 m
Reputation Power: 825
The CSS validator at w3c.org does not return an error nor a warning when you re-declare a style like you have.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #4  
Old March 9th, 2004, 08:39 PM
Fahrvergnuugen Fahrvergnuugen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Galway, NY
Posts: 183 Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level)Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 22 h 41 m 31 sec
Reputation Power: 8
Send a message via AIM to Fahrvergnuugen
interesting...
i thought i read somewhere a long time ago about the proper way to override a style by re-declaration, but i think it had something to do with using linked style sheets and embedded sheets in the header. It didn't mention anything about doing it inline like I have here.

Reply With Quote
  #5  
Old March 9th, 2004, 10:14 PM
khwang's Avatar
khwang khwang is offline
Über nübe
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Babylon 4
Posts: 240 khwang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 27 sec
Reputation Power: 6
You don't want to use JavaScript to set the style?
__________________
Hello, old friend...

Reply With Quote
  #6  
Old March 11th, 2004, 11:54 AM
Fahrvergnuugen Fahrvergnuugen is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Galway, NY
Posts: 183 Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level)Fahrvergnuugen User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 22 h 41 m 31 sec
Reputation Power: 8
Send a message via AIM to Fahrvergnuugen
i came up with a pretty basic solution. i just split the tags by ; and then again by :. That gave me a keyed array an consequently weeded out the duplicates.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Question: Is this legit / supported / compliant?


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 4 hosted by Hostway
Stay green...Green IT