用CSS3 box-sizing 属性实现两个并排的容器,如果想让容器中间有间隔该如何实现
黄舟
黄舟 2017-04-17 11:15:02
0
5
1066

"
<style>
.container{
margin: 10px 20px;
height: auto;
overflow: hidden;
}
.box{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox /
-webkit-box-sizing:border-box; /
Safari */
width:50%;
float: left;
height: 80px;
margin-bottom: 10px;
background: #fff;
border-top: 5px solid #004389;
text-align: center;
}
</style>

        <p class="container">
            <p class="box">
                <a href="" class="post">产品经理</a>
                <span>广州</span>
                <span class="salary">10k-15k</span>
            </p>
            <p class="box">
                <a href="" class="post">产品经理</a>
                <span>广州</span>
                <span class="salary">10k-15k</span>
            </p>
        </p>

``
想实现两个并排的容器中有一定的间隔,并且浏览器宽度改变时,间隔宽度不变

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(5)
刘奇

Just set the margin value, but the width needs to be adjusted slightly

左手右手慢动作

。。。。。。。。。。。

伊谢尔伦

margin outer border padding.

Peter_Zhu

Easy to set transparent border
Or just apply another layer and use whatever you want

迷茫

If you want to achieve a uniform spacing effect in the overall layout, it is recommended that you use CSS3’s flexible box layout (box-flex)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template