CSS CSS Web page background picture settings

Source: Internet
Author: User
Tags repetition set background

Just learn css, understand the next page background map settings, by the way record.

The following is mainly to achieve the position of the background map remains the same, that is, the function does not move with the scroll bar.

Body {    background-image:url (images/bck.png);     background-repeat:no-repeat;     background-attachment:fixed;     background-position:0px 0px;}

Background-image: The address of the background map;

background-repeat: Whether the picture is duplicated;

Parameters:

Repeat-x: Transverse repetition;

Repeat-y: longitudinal repetition;

No-repeat: no repetition;

The default is both horizontal and vertical repetition, where everyone can try their own results.

background-attachment: Set background attachment properties;

Parameters:

Scroll: indicates scrolling with content;

Fixed: It is stationary, not affected by content scrolling;

The default is scroll, where everyone can try their own results.

background-position: Set the picture position, that is, set the x-axis and y-axis values of the coordinates of the upper-left corner of the picture, which do not need to be set, the default value is 0;

The above code to create a new CSS class, and then in the head of the HTML reference can be implemented;

Reference method:

<href=type=rel="stylesheet" ></link>    

CSS CSS Web page background picture settings

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.