1, HTML+DIV+CSS 0 Basic Quick start to Production Enterprise Station Video course _15 CSS Background properties

Source: Internet
Author: User

Background properties:

Background-color background Color

Background-image background image

Background repetition:

Background-repeat:repeat/no-repeat/repeat-x/repeat-y

Background position: background-position:

Position:x y:

? Pixels: 100px 100px

? Percentage: 10% 20%: (Container width-picture width) *10%

? Left center right, top center bottom;

? -100px,0px

Background-attachment: Background Follow content scrolling or pinning

background-attachment:fixed;

Background-attachment:scroll;

Compound notation:

Background:url ("./img/2.jpg") center top no-repeat Scroll;

. html

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Background 2</title>6     <Linkrel= "stylesheet"href= "./bg2.css">7 </Head>8 <Bodystyle= "height:2000px;">9     <P>0</P>Ten     <P>1</P> One </Body> A </HTML>

. css

Body {
Background: #fff URL ("http://real2.s-angels.com/images/sample/m254_misa/thumb/model_top.jpg") Center top No-repeat Fixed
}

1, HTML+DIV+CSS 0 Basic Quick start to Production Enterprise Station Video course _15 CSS Background properties

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.