<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <title> 页面名称 </title><style type="text/css">#test1 { width: 16px; height: 17px; background: #999 url("http://img.bbs.csdn.net/upload/201509/17/1442477922_879930.png") no-repeat left bottom;}#test2 { width: 16px; height: 17px; background: #999 url("http://img.bbs.csdn.net/upload/201509/17/1442477922_879930.png") no-repeat left top;}</style></head><body><div id="test1"></div>-----------------------------<div id="test2"></div></body></html>
啊啊 会了 就是用个容器把图片包住,容器设置高度
然后css设置图片的position属性为relative,还有top为XXpx
就可以实现效果了
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号