I'm having trouble getting a background image to display in a div and life cannot understand for me why ...
This is the structure that I have:
Folder \style.css \index.html \Images \bookone.jpg
I want the bookone.jpg file bookone.jpg be the background of the div. So the CSS path will be Folder / style.css, and the image path will be Folder / Images / bookone.jpg. I have the code below in the html and css file, but when viewing it, nothing happens.
.book { height: 300px; width: 300px; margin: 0px; padding: auto; border: 1px solid #000; } #bookone { background: url(..\Images\bookone.jpg) ; background-repeat: no-repeat; background-position: center; background-size: cover; }
<div id="bookone" class="book"></div>
source share