您的位置:首页 > Web前端 > CSS

background属性用法详解和CSS-Sprite技术

2016-01-06 00:00 731 查看
background 是CSS简写属性,用来集中设置各种背景属性。background 可以设置:background-color, background-image, background-position, background-repeat, background-size, background-attachment

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style> .a,.b,.c,.d{ width: 200px; height: 200px; background-color:url(1.gif); background-repeat: no-repeat; } .a{ background-position: 10px 10px; } .b{ background-position: 10px 20px; } .c{ background-position: 10px 30px; } .d{ background-position: 10px 40px; } </style>
</head>
<body>
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
<div class="d"></div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: