标签:otto oct bsp type demo cli blog 尺寸 track
二、实践:
1.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> body{ background: #000 url(images/2-11-test.jpg) center center fixed no-repeat; -moz-background-size: cover; -webkit-background-size: cover; -o-background-size: cover; background-size: cover; } @media only all and (max-width:1024px) and (max-height: 768px){ body{ -moz-background-size: 1024px 768px; -webkit-background-size: 1024px 768px; -o-background-size: 1024px 768px; background-size: 1024px 768px; } } @media only all and (max-width:640px) and (max-height: 480px){ body{ -moz-background-size: 640px 480px; -webkit-background-size: 640px 480px; -o-background-size: 640px 480px; background-size: 640px 480px; } } </style> </head> <body> <div></div> <div class="div1" ></div> <div class="div2" ></div> <div class="div3" ></div> <div class="div4" ></div> </body> </html>2.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style type="text/css"> .demo{ width: 500px; height: 300px; border:20px solid rgba(104,105,168,0.5); border-radius: 10px; padding: 80px 60px; color:#123589; font-size: 25px; line-height: 1.5; text-align: center; } .multipleBg{ background: url("images/round-box1.jpg") no-repeat left top, url("images/round-box-2.jpg") no-repeat right top, url("images/border-radius.jpg") no-repeat left bottom, url("images/tabs-image.jpg") no-repeat right bottom, url("images/border.jpg") no-repeat right bottom; -webkit-background-origin: border-box,border-box,border-box,border-box,padding-box; -moz-background-origin: border-box,border-box,border-box,border-box,padding-box; -o-background-origin: border-box,border-box,border-box,border-box,padding-box; background-origin: border-box,border-box,border-box,border-box,padding-box; -moz-background-clip: border-box; -webkit-background-clip: border-box; -o-background-clip:border-box; background-clip: border-box; } </style> </head> <body> <div class="demo multipleBg">用五张背景图片做出这种效果</div> </body> </html>
标签:otto oct bsp type demo cli blog 尺寸 track
原文地址:http://www.cnblogs.com/cxchanpin/p/7297434.html