How can I access to the css file where is the header's background image?

background: url("http://xxx.es") no-repeat scroll center top / 1600px auto transparent;

It's not in the style.css

  • 1
    Browse through your theme folder. Or better yet, check that xxx.es URL full path and track it down.
    – Christine Cooper
    Commented Aug 29, 2013 at 14:23
  • Are you looking for the image file or the place where the CSS is created?
    – s_ha_dum
    Commented Aug 29, 2013 at 14:38
  • I'm looking for the css file. I want to make the background image responsive (increase or decrease according to the resolution).
    – Manolo
    Commented Aug 29, 2013 at 14:47
  • If you are using Chrome Developer Tools (or Firefox with Firebug) you can view the properties of the header using inspect element. Your matched CSS Rules will tell you the location of the file with that css. If it is your page itself, then it means the css is probably being generated through the functions.php file or the a theme php file. Commented Aug 29, 2013 at 14:55
  • I've found it in custom-header.php (echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;';). Now, I can't do what I did with a <img> tag (max-width:100%; height:auto; width:auto\9; /*ie8*/). How can I do it with a background image?
    – Manolo
    Commented Aug 29, 2013 at 15:24

1 Answer 1


This is an inline CSS from source code, normally it's because there is somewhere in the theme options where you can upload an image for header and the code was written to process that case by inserting an inline CSS directly. If you already found that line of code in header.php then you can replace the $header_image with your own image. After that you can strip off the inline CSS, make a class for the header image and add the properties to the style.css file.

You can use code tag in your post when quoting codes so it's easier for us to read the code and help you further.

  • Thanks. I had already changed the custom-header.php. Removed the 1600px for image displaying and added a 100% width option. This way I could come back to my default configuration.
    – Manolo
    Commented Aug 30, 2013 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.