Background Background Setting background color
<ptml> <pead> <style type= "Text/css" > body {background-color:yellow} h1 {background-color: #00ff00 } h2 {Background-color:transparent} p {Background-color:rgb (250,0,255)} </style> </pead> <body> <p>this is header 1</p> <p>this are header 2</p> <p>this is a paragraph</p> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Set a picture as background
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' yun_qi_img/bgdesert.jpg ')} </style> </pead> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Repeat background picture vertically
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' yun_qi_img/bgdesert.jpg '); Background-repeat:repeat} </style> </pead> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Horizontal Repeat background picture
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' yun_qi_img/bgdesert.jpg '); Background-repeat:repeat-x} </style> </pead> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
How to place a background picture (position)
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' yun_qi_img/bgdesert.jpg '); Background-repeat:no-repeat; Background-position:center; } </style> </pead> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Background does not scroll
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' yun_qi_img/smiley.gif '); Background-repeat:no-repeat; background-attachment:fixed} </style> </pead> <body> <p>the image won't scroll with t He rest of the page</p> <p>the image won't scroll with the rest of the page</p> <p>the image Won't is scroll with the rest of the page</p> <p>the image would not scroll with the rest of the Page</p> ; <p>the image won't scroll with the rest of the page</p> <p>the image won't be scroll with the rest o f the page</p> <p>the image won't scroll with the rest of the page</p> <p>the image won't Scroll with the rest of the page</p> <p>the image would not scroll with the rest of the page</p> <p& Gt The image would not be scroll with the rest of the page</p> <p>the image would not be scroll with the REST of the page</p> <p>the image won't scroll with the rest of the page</p> <p>the image would Not scroll with the rest of the page</p> <p>the image would not scroll with the rest of the page</p> & Lt;p>the image won't scroll with the rest of the page</p> <p>the image won't be scroll with the rest of The page</p> <p>the image won't scroll with the rest of the page</p> <p>the image would not s Croll with the rest of the page</p> <p>the image would not scroll with the rest of the page</p> <P&G T The image won't be scroll with the rest of the page</p> <p>the image would not scroll with the rest of the Pag E</p> <p>the image won't scroll with the rest of the page</p> <p>the image would not scroll WI Th the rest of the page</p> <p>the image won't scroll with the rest of the page</p> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
The Background property is resolved by one line (defining the Background property with one line of text)
<ptml> <pead> <style type= "Text/css" > body {background: #00ff00 url (' yun_qi_img/smiley.gif ') no- Repeat fixed Center; } </style> </pead> <body> <p>this is some text</p> <p>this is some text</p> ; <p>this is some text</p> <p>this are some text</p> <p>this is some text</p> <p> ; This is some text</p> <p>this is some text</p> <p>this are some text</p> <p>this is Some text</p> <p>this is some text</p> <p>this are some text</p> <p>this is some Tex T</p> <p>this is some text</p> <p>this are some text</p> <p>this is some text</p& Gt <p>this is some text</p> <p>this are some text</p> <p>this is some text</p> <p> ; This is some text</p> <p>this are some text</p> <p>this is some text</p>; This is some text</p> <p>this are some text</p> <p>this is some text</p> </body> & Lt;/html>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]