css - Adding background image in HTML5 Boilerplate -


i've downloaded html5 boilerplate , trying grasp on how incorporate css codes in side of main.css of html5 boilerplate. need know how can add background image page?

  html {     background:url(images/laptop.jpg) no-repeat center center fixed;     -webkit-background-size: cover;     -moz-background-size: cover;     -o-background-size: cover;      background-size: cover;        } 

try this:

body {   background-image:url(../images/laptop.jpg) no-repeat center center fixed;   // rest of code } 

your css file should in css folder , image should in different folder. therefore, used ../ before path.

here brief description of file paths:

./ means current directory

../ means parent of current directory, not root directory

/ root directory

myfile.text in current directory, ./myfile.text

../myfile.text 1 level above , /myfile.text lives in root directory.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -