Since <p> is a block level element, it adds a new line both before and after the element. But you can do it as an inline block level by setting display:inline-block; plus width:100%; to expand the width.
* { margin: 0; padding: 0; } .widget-column { margin: 10px; text-align: center; columns: 5em 3; -o-columns: 5em 3; -ms-columns: 5em 3; -moz-columns: 5em 3; -webkit-columns: 5em 3; column-gap: 0px; -o-column-gap: 0px; -ms-column-gap: 0px; -moz-column-gap: 0px; -webkit-column-gap: 0px; } .widget-column p { background: #EEE; padding: 1em; display: inline-block; width: 100%; }
<div class="widget-column"> <p>Column</p> <p>Column</p> <p>Column</p> <p>Column</p> <p>Column</p> </div>
Derek s
source share