overriding inline styles?

J

John Salerno

Concerning the joys of working with someone else's markup: Is there a
way to have my external stylesheet override the inline fonts (and other
deprecated style elements) that are in these other html files?

I'm afraid of the answer I might hear.... :)
 
J

Jukka K. Korpela

John Salerno said:
Concerning the joys of working with someone else's markup: Is there
a way to have my external stylesheet override the inline fonts (and
other deprecated style elements) that are in these other html
files?

Yes, but you need to use !important.
 
F

Frank Olieu

_John Salerno_ skrev | wrote | écrivit (31-01-2006 22:38):
Concerning the joys of working with someone else's markup: Is there a
way to have my external stylesheet override the inline fonts (and other
deprecated style elements) that are in these other html files?

I'm not exactly sure what you mean here... but if you're thinking of <font>
tags, then yes, you can override them in your external CSS:

font {font-family:sans-serif;...}

Depending on the document's markup, you could even be more specific:

p.myclass font {font-family:sans-serif;text-decoration:underline;...;}
td font {font-family:monospace;color:red;...;}
font {font-size:1em;}
... and so on.

Not very elegant, but it works...
 
J

John Salerno

Frank said:
_John Salerno_ skrev | wrote | écrivit (31-01-2006 22:38):


I'm not exactly sure what you mean here... but if you're thinking of <font>
tags, then yes, you can override them in your external CSS:

font {font-family:sans-serif;...}

I don't think that works as written. Inline styles always override
external styles, right?
 
F

Frank Olieu

_John Salerno_ skrev | wrote | écrivit (01-02-2006 03:15):
I don't think that works as written. Inline styles always override
external styles, right?

What I meant was that if you have this type of HTML code (attributes not to be
confused with inline style!):

<font size="2" face="arial">blah-blah</font>

then you can /style/ the <font> tag using CSS (external or else) in one of the
ways I described in my previous post, and override the values contained in the
HTML attributes. And believe me, it works! (I've been there :)
 
J

John Salerno

Frank said:
What I meant was that if you have this type of HTML code (attributes not to be
confused with inline style!):

<font size="2" face="arial">blah-blah</font>

then you can /style/ the <font> tag using CSS (external or else) in one of the
ways I described in my previous post, and override the values contained in the
HTML attributes. And believe me, it works! (I've been there :)

Oh, you're right, they are attributes! Awesome, that should do the trick
then. Thanks! :)
 
N

Nico Schuyt

John said:
Concerning the joys of working with someone else's markup: Is there a
way to have my external stylesheet override the inline fonts (and
other deprecated style elements) that are in these other html files?

If it's a website you want to view the way you like: In IE apply your own
stylesheet with 'accessibility options'
In case of using coding of someone else in your own HTML: clean the coding
snippets with Detagger http://www.jafsoft.com/detagger/ and apply your own
markup
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top