• Hi Everyone,

    I am working on a custom template – basically just trying to convert a Bootstrap 3 layout to use for WordPress, but am running into an issue with my background images for divs.

    At first, none of my images were working when linking to my images folder, so I uploaded the media to the WordPress admin and used the links provided, which worked for all but the div backgrounds.

    Currently using the background-image property

    background-image: url(‘https://appepic.com/wp-content/uploads/2016/06/hero-background-dark.jpg’);

    Have tried using the background property instead. I’ve been looking all over for a similar problem and can’t find my answer. Do I need to have some php allowing for background images? Is there a Template Tag I should be using?

    I am new to WordPress Development. I’ve only ever built sites using HTML, CSS, JS.

    Any help would be much appreciated! The site is not live currently.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you know how to use a web debugging tool like Firebug or Chrome Developer Tools? You probably want to check to make sure that a child element within the div isn’t keeping the background image from showing up. For example, if there’s a child div which has a background-color property set, then the underlying div‘s background won’t show up. But what you have is correct. I assume that since you’ve used CSS in the past you are using the correct selector for the div that you are trying to change, but again, either Firebug or Chrome DevTools should tell you if the rule that you think should apply to the div is actually being used.

    Thread Starter divbackgroundsadness

    (@divbackgroundsadness)

    Hey! Thank you for your response. Turns out, I had done everything right. I just needed to wait for the changes to reflect? Not entirely sure what happened, but I walked away for a few hours, came back, refreshed, and it was fixed.

    I guess the best solution sometimes is to just take a break!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Background-Image CSS for Divs’ is closed to new replies.