Absolute vs relative URLs
In general, it is considered best-practice to use relative URLs, so that your website will not be bound to the base URL of where it is currently deployed. For example, it will be able to work on localhost, as well as on your public domain, without modifications.
How to go up a level in the src path of a URL in HTML?
Use ..
to indicate the parent directory:
background-image: url('../images/bg.png');
CSS background-image - What is the correct usage?
The path can either be full or relative (of course if the image is from another domain it must be full).
You don't need to use quotes in the URI; the syntax can either be:
background-image: url(image.jpg);
Or
background-image: url("image.jpg");
However, from W3:
Some characters appearing in an unquoted URI, such as parentheses, white space characters, single quotes (') and double quotes ("), must be escaped with a backslash so that the resulting URI value is a URI token: '\(', '\)'.
So in instances such as these it is either necessary to use quotes or double quotes, or escape the characters.
CSS Background image not loading
here is another image url result..working fine...i'm just put only a image path..please check it..
Fiddel:http://jsfiddle.net/287Kw/
body
{
background-image: url('http://www.birds.com/wp-content/uploads/home/bird4.jpg');
padding-left: 11em;
padding-right: 20em;
font-family:
Georgia, "Times New Roman",
Times, serif;
color: red;
}
Related Topics
Radio Buttons Show Unwanted White Background in Chrome. Firefox Is Fine
Working with CSS Floats in HTML2Pdf
Media Query About Screen Size Instead of Resolution
Rotating a Svg with CSS (Animation)
Ruby on Rails Dropdown <Select> Menu - How to Style or Apply Class to The Options
How to Use Liquid Tags in CSS to Have Jekyll Use a Different Background Image on a Per-Page Basis
Overriding CSS on Github Pages Using Slate Theme
How to Prevent CSS Declaration Dropped Errors Cross Browser
Opposite of Adjacent Sibling Selector
How to Do Vertical+Horizontal Centering in CSS
Show Truncated Text Normally, But Show Full Text on Hover
Hiding Text Using "Text-Indent"
Is There Any Online Text Editor for HTML, CSS with Saving and Syntax Highlighting Facility