You can do it like this:
.parent {
display: table;
table-layout:fixed;
padding: 0;
font-size:0px;
width:100%;
}
ul {
padding: 0;
margin: 0;
}
.left, .right, .fix {
display:table-cell;
}
.left {
text-align: right;
}
li {
list-style: none;
display: inline-block;
border: 1px solid red;
font-size:16px;
}
.fix {
text-align: center;
border: 1px solid red;
width: 120px;
font-size:16px;
}
What this does is:
- add
display:table
to the.parent
and make it render with table-like logic and make it100%
. - add
display:table-cell
to.left, .right, .fix
so it will render like a table cell. Because of this, each cell will take33%
of the table width. - add
font-size:0px
to the.parent
to remove the white space betweendisplay:inline-block
elements. - set the
font-size
back to the desired value in the elements where we have the text.