CSS background settings,

Source: Internet
Author: User

One small step a day, one big step in a year.

The first blog Park article, the main record of their own learning a process.

CSS3 background

CSS3 contains a number of new background properties that provide more powerful control over the background.

    • Background-size
    • Background-origin

You'll also learn how to use multiple background images.

Browser support

Internet Explorer + +, Firefox, Chrome, Safari, and Opera support new background properties

CSS3 Background-size Properties

The Background-size property specifies the size of the background picture.

Before CSS3, the size of the background image is determined by the actual size of the picture. In CSS3, you can specify the size of the background image, which allows us to reuse the background image in different environments.

You can specify dimensions in pixels or percentages. If the dimension is specified as a percentage, the size is relative to the width and height of the parent element.

Example 1
/ * old version of Firefox */background-size:63px 100px;background-repeat:no-repeat;}
BACKGROUND-SIZE:63PX 100px; Indicates that the left and right widths are 63 pixels and up and down is 100 pixels.
Example 2

Stretch the background image so that it finishes filling the content area:

/ * old version of Firefox */background-size:40% 100%;background-repeat:no-repeat;}

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.