背景图片自适应 1 2 3 4 5 无标题文档 6 7 div { 8 position: absolute; 9 width: 100%;10 height: 100%;11 z-index: -1;12 }13 img {14 position: fixed;15 }16 17 18 19 20 21 22 ログイン後にコピー 元素自适应居中于网页 无标题文档div { position: absolute; top: 50%; left: 50%; width: 200px; height: 200px; margin: -100px 0 0 -100px; border: 1px solid yellow; background-color: #F6C;}ログイン後にコピー CSS3使图片变灰 1 2 3 4 5 6 7 test 8 9 .gray {10 -webkit-filter: grayscale(100%);11 -moz-filter: grayscale(100%);12 -ms-filter: grayscale(100%);13 -o-filter: grayscale(100%);14 filter: grayscale(100%);15 filter: gray;16 }17 img {18 width: 200px;19 height: 200px;20 }21 22 23 24 25 26 27 ログイン後にコピー