CSS and element.style

Hey there!

I have just started working on fixing up a blog for a client of mine as her posts and sidebars were all showing different fonts. I got the CSS cleaned up but now I am seeing something really odd.

I have noticed that throughout all her posts, there are the odd ones that are still showing the wrong font. While using Firebug I have found that all these “odd” posts have an element.style but I can not for the life of me find where these elements are. I have searched the CSS a number of times and nothing there.

It appears as though this element.style is overriding the fonts set up in the CSS. Does anyone know what these are, how they got there or how I can get rid of them?

Any help would be greatly appreciated.

element.style means the styles are applied inline in the html - look for a style=" " attribute in the html. These will always override the styles set in a stylesheet.

When I look in the HTML of each post there is nothing there. Am I looking in the wrong place?

Does Firebug show anything different in the html in these areas? Do you have a link to this online?

It won’t appear in the HTML because it won’t show any HTML modified by JavaScript. However, if you do “Select All” (ctrl+A) and then right click somewhere and choose “View selection source”, then you should see all the HTML, included what was done by JavaScript. Look for style=" in there.


I see it in the HTML via Firebug and Viewing the source, but how do I get rid of it? This is a Wordpress blog.


Oh and… How did it get there in the first place?

This is dynamically updated via Javascript. I suggest looking for “.style” in the JS being used, or link us to it if you’re not comfortable looking at JS.

LOL…ok that would be great if I knew what JS was being used.

I would give you a link but I’m not up to 10 posts yet. Just joined today.

Just post the url without the www part and put a space or two between the dots - it will then show as text which we can copy/paste.

Here ya go.

www .mykelsellsreos. com/page/2/


<p class="MsoNormal" style="margin: 0in 0in 12pt; line-height: normal;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">

This means that wherever the posts are stored, there are inline styles. I think MsoNormal is generated by MS Word, so you’d have to go through and get rid of these manually unless you know regex which you may use on the database content files.

Oh man…I was wondering if that might be the case.

No I don’t know regex. Guess I’ll be doing it all manually.

Thank you all for your help.

That would be a lot of manual work. Why don’t you just use the class and override the styles?

p.MsoNormal { color:red !important; margin:0 !important; }

The !important declarative would override the inline styles.

That would be wicked thank you! …Where do I put that?

Sorry for the dumb questions.

In an external stylesheet, along with the rest of your rules.

Oh boy…I think that just went way over my head. I didn’t create the style sheet so technically I don’t have any of my own rules. LOL

Sorry :frowning: