Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 15th, 2006, 07:43 PM
Akdor 1154 Akdor 1154 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Center Canyon in a Raptor
Posts: 34 Akdor 1154 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 44 sec
Reputation Power: 4
Selectively overriding CSS

Hi,

Just playing around with user.css (Opera's equivalent to userContent.css); is there any way to override rules to an element based on CSS rules, not attributes? That sounds very confusing, so here's an example of what DOES work:

In the page:
Code:
<font face="terminal">Stupid bitmap font that renders illegibly with Opera</font>


And in my user.css:
Code:
*[face="terminal"] {
   font-family: lucida console, sans-serif;
   };


BUT unfortunately, for once it's a BAD thing that the page designers are adhering to standards:
In the page:
Code:
* {
   font-family: terminal;
   }


Is there a way to override this without reading the entire web in Lucida Console?

Last edited by Akdor 1154 : January 15th, 2006 at 07:48 PM. Reason: Forgot closing tag; The difference a single comma can make!

Reply With Quote
  #2  
Old January 16th, 2006, 12:31 AM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 135 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 45 m 13 sec
Reputation Power: 4

Reply With Quote
  #3  
Old January 16th, 2006, 01:36 AM
Akdor 1154 Akdor 1154 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Center Canyon in a Raptor
Posts: 34 Akdor 1154 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 44 sec
Reputation Power: 4
No, the overriding itself isn't the problem, Opera give user style sheets highest priority. It's specifying what needs to be overwritten. If the Terminal font was specified in the attribute, I could use *[face="terminal"] as a selector, but as it's specified in CSS, this doesn't work. Is there a way to achieve the same effect as if it's with an attribute?

Reply With Quote
  #4  
Old January 16th, 2006, 01:54 AM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 135 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 45 m 13 sec
Reputation Power: 4
Oh... No. If you wanted to go to the trouble, you might be able to write a JavaScript script to do it.

I suppose you could delete fonts you don't like from your computer and then Opera would pick a different font to display.

Reply With Quote
  #5  
Old January 16th, 2006, 08:54 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
I'm intrigued by this idea, and I'll be honest, I don't have an answer.
I think one of the flaws with your example is the fact that most web designers don't use FONT tags anymore.

Would an Opera user.css file override something like:
Code:
<span style="font-family: terminal">Some words</span>
Just something more to consider. I don't know if deleting unwanted fonts is the best solution. I'm thinking of this more from an accessibility standpoint, it would be cool to have a user.css file that you can provide people, making it [1] modular and [2] undo-able.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #6  
Old January 16th, 2006, 06:34 PM
Akdor 1154 Akdor 1154 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Center Canyon in a Raptor
Posts: 34 Akdor 1154 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 44 sec
Reputation Power: 4
Hmm... I wonder if separate CSS <style type="test/css"> rules count under the "style" attribute?

Time for some testing...

I never thought I'd be sad to see the <font> tag go...

Reply With Quote
  #7  
Old January 16th, 2006, 06:44 PM
Akdor 1154 Akdor 1154 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Location: Center Canyon in a Raptor
Posts: 34 Akdor 1154 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 44 sec
Reputation Power: 4
Post-testing:

No, in Opera at least the style="" attribute is totally ignored for attribute selecting. Damn.

Reply With Quote
  #8  
Old January 17th, 2006, 08:40 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
I'm glad to see the font tag go! It only makes sense... keep presentation teir out of the data. HTML is like plain old data, and it's CSS that makes it pretty. I'm glad the <B>, <U>, <I> tags are on their way out too... =)
But that's a rant deserving of it's own thread.

Code:
*[face="terminal"] {
   font-family: lucida console, sans-serif;
   };
I think this syntax is supported in CSS3. I may be wrong though. If so, Opera hasn't implemented it (neither have any other mainstream browsers that I know of).

Perhaps the user.css isn't the greatest solution for you. What is it you're ultimately trying to achieve?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Development > Selectively overriding 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 1 hosted by Hostway
Stay green...Green IT