css - HTML background-image not showing on screen -


i trying create full width image above nav bar, cant image show on screen. here simple html:

<html>   <body>     <div class="wrapper" />   </body> </html> 

and css:

.wrapper {   background-image: url(../assets/bridge.jpg);   background-repeat: no-repeat;   background-size: 100%;   width: 100%;   height: 100%; } 

i see jpg made browser , can click on in resources, there no problem path. screen still blank , showing nothing. awesome.

this because height:100% functionally useless, , div resultingly has no height.

if give div fixed height, image should appear expected.

alternatively if want background image apply background of page, can apply <html> element , avoid whole wrapper, 100% debacle.

html {      background-image: url(../assets/bridge.jpg);      background-repeat: no-repeat;      background-size: 100%; } 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -