I have 3 li items - each with a width of 33.3%. Im trying to create a margin-right
gap between each <li>
- however the extra margin makes the total <li>
width exceed 100% and break down on a new line.
Would I be able to sort this with some border-box approach? Tried to apply it globally, with no luck.
http://codepen.io/anon/pen/jbazaN
html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}
.content {
width: 700px;
background: gray;
padding: 20px;
}
ul {
list-style: none;
margin: 0;
padding: 0;
}
ul li {
float: left;
width: 33.3%;
margin: 0 20px 0 0;
background: blue;
}