css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose
来源:懂视网
责编:小采
时间:2020-11-27 16:09:32
css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose
css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose:.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;}
导读css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose:.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;}

.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;}
实际上效果:文字3的div被挤到了第二排。
究其原因:编辑器换行会是的两个元素之间有个小空隙,把html代码进行如下改造就OK了
版权声明:本文为博主原创文章,未经博主允许不得转载。
css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose
css把元素放在一行width:33%,结果却是两行的原因_html/css_WEB-ITnose:.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;}