Reputation: 4491
I have a basic tree structure. The container is scrollable horizontally. I have right padding on all <li>
elements. However, the right padding is not taking effect. How can I fix it so it takes effect?
ul {
height: 100%;
margin: 0;
padding: 0;
list-style: none;
}
div {
width: 150px;
background: white;
height: 100%;
overflow: auto;
}
li {
white-space: nowrap;
height: 35px;
line-height: 25px;
font-size: 15px;
padding-right: 25px;
}
body {
margin: 0;
background: coral;
font-family: apple-sytem,BlinkMacSystemFont,sans-serif;
}
body,
html {
height: 100%;
}
<div>
<ul>
<li>
Thing
</li>
<li style="padding-left: 25px;">
Another thing
</li>
<li style="padding-left: 50px;">
A really long thing
</li>
<li style="padding-left: 75px;">
An even longer thing
</li>
</ul>
</div>
Upvotes: 0
Views: 264
Reputation: 1095
Add display: inline-block
to the <li>
element and it will work.
Upvotes: 2