html - 移动端css页面 padding和box-sizing:border-box
本文介绍了html - 移动端css页面 padding和box-sizing:border-box的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
左边实现 我的需求,右边没实现 。
以上的图就可以看出 margin:0 30px 左边已经实现需求,右边没实现 。右边不能对边是怎么实现的?
.line{
height:2px;
background: #000;
width: 100%;
margin:0 30px;
box-sizing: border-box;
overflow-x: hidden;
}
如何让一条直线不对边?
http://jsbin.com/yucoyukuqi/edit?html,css,js,output
解决方案
第一种方法是:
http://jsbin.com/manigerijo/edit?html,css,js,output
第二种方法:
http://jsbin.com/bicibipeti/edit?html,css,js,output
这篇关于html - 移动端css页面 padding和box-sizing:border-box的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文