Why do 2 elements of 50% not fit in the same row

Viewed 1906

Question

If both <li> are 50%, why won't they be side by side?

Code

Demo on jsfiddle.

HTML

<ul>
    <li>left</li>
    <li>right</li>
</ul>

CSS

ul {
    padding: 0;
}
li {
    list-style: none;
    display: inline-block;
    width: 50%;
    font-size: 12px;
    color: gray;
    background-color: rgb(216, 216, 216);
    padding: 3px;
    text-align: center;
    border: 1px solid rgba(179, 179, 179, 0.83);
}
6 Answers
Related