I want to separate content from formatting, but IE seems to want them to stay together. Basically, I'm loading the content from an XML file then using Javascript to create the page. I use CSS to describe the formatting based on the elements, or in some cases the classes, on the page.

Unfortunately, IE (8 - but I recall having the same problem in 6 and 7) seems to ignore this. For example, I can create a "b" element but the text won't go bold. Or I can setAttribute('style', 'font-weight: bold') and it again is ignored. If I setAttribute the class to something that is defined as bold in the .css, it is again ignored. Finally, if I define the element style as "font-weight: bold" in the .css, it's still ignored.

I'm using bold as an example, but it is happening no matter what formatting I try to apply. This includes text-align or cell alignment properties.

Anyone know how I can set the formatting without mixing it in with the content?