I can\'t seem to make my plaid.jpg the background on any of my pages, let alone all of them, I\'ve tried selecting it by body, html, *, the specific id of \"home\". nothing
<style>
background: url(images/Untitled-2.fw.png);
background-repeat:no-repeat;
background-position:center;
background-size: cover;
</style>
If that really is all that's in your CSS file, then yes, nothing will happen. You need a selector, even if it's as simple as body
:
body {
background-image: url(...);
}
You may debug using two ways:
Press CTRL+U to view page Source . Press CTRL+F to find "mystyles.css" in source . click on mystyles.css link and check if it is not showing "404 not found".
You can INSPECT ELEMENT IN FIRBUG and set path to Image ,Set Image height and width because sometimes image doesnt show up.
Hope this may works !!.
Most important
Keep in mind that relative URLs are resolved from the URL of your stylesheet.
So it will work if folder images
is inside the stylesheets
folder.
From you description you would need to change it to either
url("../images/plaid.jpg")
or
url("/images/plaid.jpg")
Additional 1
Also you cannot have no selector..
CSS is applied through selectors..
Additional 2
You should use either the shorthand background
to pass multiple values like this
background: url("../images/plaid.jpg") no-repeat;
or the verbose syntax of specifying each property on its own
background-image: url("../images/plaid.jpg");
background-repeat:no-repeat;
Try this:
body
{
background:url("images/plaid.jpg") no-repeat fixed center;
}
jsfiddle example: http://jsfiddle.net/Q9Zfa/
You either use :
background-image: url("images/plaid.jpg");
background-repeat: no-repeat;
... or
background: transparent url("images/plaid.jpg") top left no-repeat;
... but definitively not
background-image: url("images/plaid.jpg") no-repeat;
EDIT : Demo at JSFIDDLE using absolute paths (in case you have troubles referring to your images with relative paths).