I have a nested unordered list that has the main content on the left, and I would like to add options that float to the right, so that they are aligned to the right, regardless of the indent level.
<ul>
<li> Item 1 <span class='options'> link </span> </li>
<li> Item 2 <span class='options'> link </span>
<ul>
<li>Item 3 <span class='options'> link </span> </li>
</ul>
</li>
</ul>
I have the following css:
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
padding-left: 15px;
width: 400px;
}
.options {
float: right;
width: 50px;
}
If used, the range of options is aligned to the right, but 1 line below the expected line.
How can I get a range of options to fit a list item?
TIA, Adam
source
share