<style type="text/css">
.aa , .bb {
background-image:url(a.png);
background-repeat: no-repeat;
text-indent:-999em;
}
.aa {
width:36px;
height:36px;
background-position: 0 0;
}
.bb {
width:14px;
height:16px;
background-position: 0 -56px;
}
</style>
.aa , .bb {
background-image:url(a.png);
background-repeat: no-repeat;
text-indent:-999em;
}
.aa {
width:36px;
height:36px;
background-position: 0 0;
}
.bb {
width:14px;
height:16px;
background-position: 0 -56px;
}
</style>
<body>
<div class="aa"></div>
<div class="bb"></div>
</body>![]()
file: a.png
本文介绍了一种使用CSS设置背景图像并精确控制其位置的方法。通过不同类名应用特定样式,实现了两个不同大小和位置的图像显示效果。
171

被折叠的 条评论
为什么被折叠?



