background的简写属性

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title></title>
 6     </head>
 7     
 8     <script type="text/javascript">
 9     </script>
10     <style type="text/css">
11         body{
12             /*
13             height: 5000px;
14             background-color: #bfa;
15             background-image: url(img/3.png);
16             background-repeat: no-repeat;
17             background-position: center center;
18             /* 设置背景图片不随滚动条滚动 
19             background-attachment: fixed;
20             */
21            /* background
22            简写属性 通过该属性可以同时设置所有背景相关的样式 
23            没有顺序 数量 的要求 不写的样式使用默认值
24            */
25            background: #bfa url(img/3.png) center center no-repeat fixed;
26            
27         }
28     </style>
29     <body>
30     
31     </body>
32 </html>

猜你喜欢

转载自www.cnblogs.com/zuiaimiusi/p/11229180.html