My current understanding is that different HTML elements are separated in their functionality by their default CSS styling, semantics aside.
Using custom CSS, you could (inadvisably) make any HTML element behave like any other.
If that is correct, the only thing I cannot account for is the bullets on <li>
elements. What CSS causes them? How can you add that to other elements?
Note to future readers: I recently learned HTML elements also differ by content categories.
First, place the <ul>… </ul> tags around the text to turn into a bulleted list. Second, place the <li>… </li> tags around each line item in the list.
HTML exampleAdding the "list-style: none" CSS class to the unordered list (<ul>) or ordered list (<ol>) tag removes any bullet or number.
<ul>: The Unordered List element. The <ul> HTML element represents an unordered list of items, typically rendered as a bulleted list.
To create unordered list in HTML, use the <ul> tag. Unordered list starts with the <ul> tag. The list item starts with the <li> tag and will be marked as disc, square, circle, none, etc.
The bullets are contained "within" the padding of <ul>
element:
The padding is marked green and the margin orange:
Decreasing the padding shows that the bullets are "within" that padding:
Increasing the margin of the <ul>
for example, shifts it right.
The list-style
property controls the bullets themselves. Setting it to none
will hide them. You would need to set the margin and padding to 0
if you want to get rid of the indent too.
ul { list-style: none; }
If you want to get rid of all margins / paddings and the bullet points, use this:
ul { list-style: none; margin: 0; padding: 0; }
div { padding-left: 40px; } a { display: list-item; list-style: disc; }
<div> <a href="#">Item #1</a> <a href="#">Item #2</a> <a href="#">Item #3</a> <a href="#">Item #4</a> </div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With