Search code examples
cssinline-styles

Overide inline font face?


Im importing an XML feed which has inline styles applied to its divs like:

 face="Verdana"

I want to override this with CSS. Ive tried this:

#containing-div div {  
    font-family: arial !important; 
}

But its not working. As 'face' is deprecated I'd hoped it would be overridden with the 'font-family' but it appears not to be. Given that I can't change the XML feed (I know I should be able to but just trust me!), how can I override this? Thanks


Solution

  • Assuming that this:

    face="Verdana"
    

    is actually this:

    <font face="Verdana">..</font>
    

    (and it must be, right? There's no way it's <div face="">)

    then you should use this CSS:

    #containing-div, #containing-div font {  
        font-family: arial; 
    }
    

    There should be no need for !important. The point is to select the font elements.