Search code examples
cssinline-styles

override inline style background-image


I need to override the following inline style:

<div class="header" style="background:url(http://domain.org/headers/header_image.jpg) top right repeat-y;">

I have tried the adding the below in an external style sheet but it is not working.

.header[style] {background-image:none;!important}

Any suggestions please?


Solution

  • You have almost got it, just do the following changes and it should work

    .header[style] {background-image:none !important;}
    

    The !important rule should be within your rule declaration only!

    For a reference.. click here