java C C unordered list in unordered list in HTML
CodePudding user response:
Try using this:
style="float: left;"
OR in the CSS file:
li {
float: left;
}
This might not work super great, but we also don't know what your code looks like...
CodePudding user response:
To display the list items next to each other, you can let them float. Don't forget to give the items some margin to avoid them overlapping each other.
li {
float: left;
margin-right: 25px;
}
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
If you don't mind the bullets being removed, you could use
li{
display: inline;
}
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>