Pages

CSS3 background-size Property

Definition and Usage

The background-size property specifies the size of the background images.
Default value: auto
Inherited: no
Version: CSS3
JavaScript syntax: object.style.backgroundSize="60px 80px"


Syntax

background-size: length|percentage|cover|contain;
Example 
 <!DOCTYPE html>
<html>
<head>
<style>
body
{
background:url("img_flwr.gif");
background-size:80px 60px;
background-repeat:no-repeat;
padding-top:40px;
}
</style>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>

<p>Original image: <img src="img_flwr.gif" alt="Flowers" width="224" height="162" /></p>

</body>
</html>

No comments:

Flag Counter
Designed by vnBloggertheme.com | Copyright © 2013 Remote Tutor