问题描述:

I'm styling an XML feed that has inline styles. So I'm going to override the inline styles with styles in a CSS file. I know that in an ideal world the XML feed shouldn't have inline styles or those styles should be stripped out, but this isn't possible.

Are their any downsides to doing this?

网友答案:

@jdln, you are right ; written clearly Here

The HTML Font Element () defines the font size, color and face for its content.

as well as

Do not use this element! Though once normalized in HTML 3.2, it was deprecated in HTML 4.01, at the same time as all elements related to styling only, then obsoleted in HTML 5. – diEcho 0 secs ago edit

网友答案:

The only way I can think of to override inline css through an external stylesheet is by using !important.

<span class="error" style="color:red">text</span>

Which can be overriden by using this:

.error {
  color: blue !important;
}

But to answer your question, this is not bad for accessibility. But it is from a coding point of view a bad thing to do, because 1 month later you will look at that html and wonder why that text is blue and not red.

相关阅读:
Top