CSS Practical Example (recommended) _css/html

Source: Internet
Author: User
Background Background Setting background color
<textarea id="runcode31686"><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> &l T;/body> </ptml></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
Set a picture as background
<textarea id="runcode97594"><ptml> <pead> <style type= "Text/css" > Body {background-image:url (' http://www.blueidea.com/ Articleimg/2006/07/3744/bgdesert.jpg ')} </style> </pead> <body> </body> </ptml></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
Repeat background image vertically
<textarea id="runcode75568"><ptml> <pead> <style type= "Text/css" > Body {background-image:url (' http://www.blueidea.com/ Articleimg/2006/07/3744/bgdesert.jpg '); Background-repeat:repeat} </style> </pead> <body> </body> </ptml></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
Repeat background image horizontally
<textarea id="runcode15089"><ptml> <pead> <style type= "Text/css" > Body {background-image:url (' http://www.blueidea.com/ Articleimg/2006/07/3744/bgdesert.jpg '); Background-repeat:repeat-x} </style> </pead> <body> </body> </ptml></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
How to place the background image (position)
<textarea id="runcode96526"><ptml> <pead> <style type= "Text/css" > Body {background-image:url (' http://www.blueidea.com/ Articleimg/2006/07/3744/bgdesert.jpg '); Background-repeat:no-repeat; Background-position:center; } </style> </pead> <body> </body> </ptml></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
Background does not scroll
<ptml> <pead> <style type= "Text/css" > Body {background-image:url (' http://www.blueidea.com/ Articleimg/2006/07/3744/smiley.gif '); Background-repeat:no-repeat; background-attachment:fixed} </style> </pead> <body> <p>the image won't 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 would not Scroll with the rest of the page</p> <p>the image won't 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 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 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 W Ill not scroll with the rest of the page</p> <p>the image would not scrollWith the rest of the page</p> <p>the image won't scroll with the rest of the page</p> <p>the im Age 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 won't scroll with the rest of the page</p> <p>the image won't scroll with the RE St of the Page</p> <p>the image won't scroll with the rest of the page</p> <p>the image would no T scroll with the rest of the page</p> <p>the image won't 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 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 won't scroll with The rest of the page</p> <p>the image won't scroll with the rest of the page</p> </body> </p Tml>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
The Background property is resolved one line (the Background property is defined in one line)
<ptml> <pead> <style type= "Text/css" > body {background: #00ff00 URL (' http://www.blueidea.com/ Articleimg/2006/07/3744/smiley.gif ') no-repeat fixed Center; } </style> </pead> <body> <p>this is some text</p> <p>this are some text</p> < P>this is some text</p> <p>this are some text</p> <p>this is some text</p> <p>This i s 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 text</p> <p>this is some text</p> <p>this are some text</p> <p>this is some text</p> <p>Th Is are 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 is some text</p> <p>this are some text</p> <p>this is some text</p> </body> & Lt;/html>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
  • 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.