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