开发者

how to remove element.style in css

I am using Joomla 1.5. i am having a page where a cSS has been added for the title which is in <strong></strong>

I firebug it , it ap开发者_JAVA百科pears as

element.style {
color:#666666;
}

i dont know of from where it comes from..

but i am having a css applied for the same tag with other color. but it disappeared. How to remove the element.style globally..


It is possible to override inline styles from an external stylesheet

strong[style] { color: blue !important; } 

This works in most major browsers, Chrome, Safari, Firefox, IE8

It doesn't work (to my knowledge) in IE6 / IE7

Hope this helps.


This code comes from HTML and not from your CSS.

This HTML with generate your element.style:

<strong style="color:#666666;">Just text</strong>

Element.style, as the name says, its the style defined on element and there is no way to override it. If you do not want that color in that element you must remove/change it on html.


It seems it is not always set in HTML. In My case the element.style is empty:

element.style {
}

It is not set in any css and it is not set in any html source. I dont't know where else I should look.


Inline styles are generated from HTML or (more often these days) javascript applying styles after the page had loaded.

Jquery is often a culprit of this, performing animations using css applied directly on the element that overrides your stylesheet.

For instance you may show, then hide a div, leaving a 'display:none' on the element that overrides any naturally cascading CSS that precedes it. This comes up often when you are mixing CSS transitions and media queries with javascript.

Check your JavaScript for any instances of applied styles.

Try using a callback function on the animation to clear styles:

$(this).css( "display", "" );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜