CSS set background fixed non-scrolling effect example

Source: Internet
Author: User
Tags set background

First, CSS set background does not scroll effect

<!doctype html public  "-//w3c//dtd xhtml 1.0 transitional//en"   "http://

Www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd "> 

Second, CSS settings body background picture fixed content scrolling

CSS to make the body background picture fixed content scrolling:

Style= "Background-attachment:fixed"


Example:

Body {

Background-image:url (images/dbg.jpg);

background-repeat:no-repeat;

font-family: "XXFarEastFont-Arial";

font-size:12px;

Line-height:normal;

Font-weight:normal;

Color: #FFFFFF;

background-attachment:fixed;

}

Third, CSS fixed background picture does not scroll

Example:


Four, CSS Settings page background does not move only the effect of rolling bar

Method One (the page background does not move only the scroll bar moves):



Method Two (the page background does not move only the scroll bar movement):


From the above examples to see the background is not scrolling through the positioning to solve, the above example is all right, you can choose your own effect code.

Related Article

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.