CSS3 > Background

Background-size Property in CSS3

How to specify the size of a background image in CSS3?

By using background-size property we can specify the size of a background image.

        body {
            background: url("snitfunda.jpg");
            background-size: 75px 65px;
            background-repeat: no-repeat;
            padding-top: 50px;

        Mr. Sheo Narayan is a software professional since 2000 (15+ years) and working in .NET Technologies since its first release. 
       He is also the founder of a popular .NET Community website http://www.DotNetFunda.com. 
       He has been awarded with Microsoft® Most Valuable Professional (MVP), Star Entrepreneur Award etc. 
       He has served thousands of professionals worldwide in solving their technical problems and teaching them in their professional careers. 
       His corporate training clients includes many MNCs.

In the above code snippet we have given the values '75px 65px' to the background-size property. In that '75px' represents the width of the image and '65px' represents the height of the image.


 Views: 503 | Post Order: 52

Write for us