给你找了一个答案
https://www.cnblogs.com/PeunZhang/p/3289493.html
如果是两个子元素可以左右浮动。
fexl盒子布局也行
可以使用flex布局实现,最终效果和实现截图参考如下:
<style type="text/css"> body { background-color: #fff; } .parent{ border:1px solid #CCC; display: flex; justify-content: space-between; } </style> <body> <div class="parent"> <div style="width:50px;height:50px;background-color:red;border:1px solid #CCC;">left</div> <div style="width:50px;height:50px;background-color:yellow;border:1px solid #CCC;">middle</div> <div style="width:50px;height:50px;background-color:blue;border:1px solid #CCC;">right</div> </div> </body>
不错 谢谢
使用flex布局 参考 http://www.jqhtml.com/6319.html
text-align: justify;可以实现,如果还不行的 ,一个空格相当于半个字符,可以通过空格控制
使用flex布局 display:flex; display: flex; justify-content: space-between;
使用flex布局 父元素设置 display: flex; justify-content: space-between; 各种你想要的效果基本都能实现
margin: 0px auto; 这样写就好了, margin是外边距的属性,0px取消掉外边,就可以顶到两头了,然后呢,auto就是水平居中.
– 找不到DNS服务器 4年前