您现在的位置:首页 >> 前端 >> 内容

css把元素放在一行 width: 33% ,结果却是两行的原因

时间:2015/7/31 10:34:48 点击:

  核心提示:.inline-block {display: inline-block;}.width33 {text-align: center;width: 33%;box-sizing: border-box...
.inline-block {
    display: inline-block;
}

.width33 {
    text-align: center;
    width: 33%;
    box-sizing: border-box;
    border-left: 1px solid white;
}

.bottom-bar {
    position: fixed;
    bottom: 0px;
    width: 100%;
    background: rgb(239, 73, 99);
    height: 50px;
}
 

文字1

文字2

文字3


实际上效果:文字3的p被挤到了第二排。

究其原因:编辑器换行会是的两个元素之间有个小空隙,把html代码进行如下改造就OK了

 

  

文字

文字

文字



 

 

Tags:CS SS S把 把元 
作者:网络 来源:凯歌的CSDN