html - Background-image won't show -


i'm trying have background image in header of website of won't show. file setup follows:

d:\ mywebsite

image, home.css, index.html

image rocks.jpg

the code have :

<div class="header-image" style=background-image: url("../image/rocks.jpg")> </div> 

edit

css:

#header .header-image {     width: 100%;     height: 400px;     background-position: left center;     background-size: 100%;     background-repeat: no-repeat; } 

your style attribute should have quotation marks around in-line css, , .. in file path sending directory (and must removed), so:

style =  'background-image:url("image/rocks.jpg");' 

edit: note must use single quotes surround css or double quotes within url("image/rocks.jpg") interpreted closing quotes.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -