Search code examples
phphtmlcssstylesfont-face

Is there a way in css to clear all font-family + font-size style declarations?


I have a page which is a cms/wysiwyg/ms word nightmare.

It pulls many paragraphs of text from a database, some of which have retained ms word's bizarre html tags - including font declarations!!! ahh!

In one sentence I can have things like:

<span style="font-family:Verdana">this is some</span>
<span style="font-family:arial">ugly text!</span>

I was wondering if there is a way of removing all font-family and font-size styles so they will adapt the master stylesheet css?

I'd prefer to not get into massive preg_replace conditions if I can avoid it. Thanks


Solution

  • CSS:

    span {
        font-family: initial !important;
        font-size: initial !important;
    }