利用margin代替小图标的绝对定位;使代码更简洁

 <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{margin:0;padding:0}
#div1{background:black;display: inline-block}
.img{width:100px;height:100px;background: #f0f;overflow: hidden}
.icon{width:30px;height:30px;background: #0ff;margin:-90px 0 0 60px}
</style>
</head>
<body> <div id="div1">
<div class="img">
</div>
<div class="icon"></div>
</div> </body>
</html>
上一篇:Android Support v4\v7\v13和AndroidX理解【转载】


下一篇:Android Support v4、v7、v13的区别和应用场景