Background Image
The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
The background image for a page can be set like this:
Example
body {background-image:url('paper.gif');}
Below is an example of a bad combination of text and background image. The text is almost not readable:
Example
body {background-image:url('bgdesert.jpg');}
Background Image - Repeat Horizontally or Vertically
By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or they will look strange, like this:
Example
body
{
background-image:url('gradient2.png');
}
{
background-image:url('gradient2.png');
}
If the image is repeated only horizontally (repeat-x), the background will look better:
Example
body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}
Background Image - Set position and no-repeat
* When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:
Example
body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}
Example
body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
Other Topics
CSS : Background-shortand property,CSS : Background image,CSS : Background color,CSS : Cascading order,CSS : Multiple style sheets,CSS : Inline styles,CSS : Internal style sheet,CSS : External style sheet,CSS : Class selector,CSS : Sticky Footer Layout,CSS : Collapse borders,CSS : List,CSS : Background color,CSS : Styling links,CSS : Padding properties,CSS : Padding-shorthand property,CSS : The lang pseudo class,CSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,CSS : Id Selector
No comments:
Post a Comment