|
@@ -0,0 +1,34 @@
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html lang="en">
|
|
|
|
+<head>
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
+ <title>Document</title>
|
|
|
|
+ <style>
|
|
|
|
+ /* 宽高 背景 */
|
|
|
|
+ div{
|
|
|
|
+ /* 宽 */
|
|
|
|
+ width:1000px;
|
|
|
|
+ /* 高 */
|
|
|
|
+ height:800px;
|
|
|
|
+ /* 背景 */
|
|
|
|
+ background-color:red ;
|
|
|
|
+ /* 背景图片url(图片地址) */
|
|
|
|
+ background-image: url(img01.jpeg);
|
|
|
|
+ /* 背景图片重复 repeat|no-repeat*/
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
+ /* 背景图片位置 x水平(固定值|left center right) y垂直 (固定值| top center bottom)*/
|
|
|
|
+ background-position:center center ;
|
|
|
|
+
|
|
|
|
+ /* 省略写法 */
|
|
|
|
+ background: red url(img01.jpeg) no-repeat center center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </style>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+ <div>我是一个div</div>
|
|
|
|
+</body>
|
|
|
|
+</html>
|