Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to Override Inline CSS Styles

    • 0
    • 3
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 556
    Comment on it

    Inline styles are those defined in the HTML itself, e.g.

            This is an 
            <strong style="color: red;">inline style that should be blue</strong>.

    Inline styles have the highest priority of all CSS. In general, I would recommend you avoid using them and place your CSS declarations in external files. However, you may not have that luxury if you do not have direct access to the HTML code.

    Fortunately, there is a way to override inline styles from an external style-sheet:

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

    Browser Support

    Internet Explorer 8+
    Mozilla Firefox 2+
    Opera 9+
    Apple Safari
    Google Chrome

 1 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: