Given a list like below there are two ways I know of.
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
</ul>
You can use float left/right
li {
float: left; /* or right */
}
Or display inline/inline-block (n.b. this way leads to problematic sizing)
li {
display: inline; /* or inline-block */
}
You can alter the padding / margin / width to suit see demo
Edit: Full example without using border-size demo
ul {
display: block;
width: 100%;
}
li {
border-left: solid 1px black;
float: left;
margin-right: -1px;
text-align: center;
width: 25%;
}
ul li:first-child {
border-left: none;
}
ul li:last-child {
margin-right: 0;
}
Example using display: table
which is now a third way I know to achieve this effect :-) demo
ul {
display: table;
width: 100%;
}
ul li:first-child {
border-left: none;
}
li {
display: table-cell;
border-left: solid 1px black;
text-align: center;
width: 25%;
}