CSS3 Tutorial: Background picture (background size and background image)

Source: Internet
Author: User

Background images/textures are used in a variety of ways and are often used to add the best final landscaping to the site. Now it is valued in the CSS3, we can apply the background image and background picture size to achieve more perfect effect.

CSS3 background picture size can be written as background-size:apx bpx;
-APX = x axis (picture width)
-bpx = y-axis (picture height)

Having learned this, we begin to experience this feature:
The best browsers to support CSS3 background size are safari and opera, so we just need to use the-O and-webkit prefixes.

Background size

#backgroundSize {border:5px solid #bd9ec4; Background:url (image_1.extention) bottom right no-repeat;- o-background-size:150px 250px; -webkit-background-size:150px 250px; padding:15px 25px; Height:inherit; width:590px; }

To apply multiple background images to CSS3, we use them to separate them, for example:

Background:url (image_1.extention) Top right no-repeat, url (image_2.extention) bottom right no-repeat;

We can try to place a number of different pictures in one line of code ...

Multi-background image

#backgroundMultiple {border:5px solid #9e9aab background:url (image_1.extention) top left no-repeat, url (image_2. extention) bottom left no-repeat, url (image_3.extention) bottom right no-repeat; padding:15px 25px; Height:inherit; width:590px; }



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.