When you need to reduce the size of bullet in a list like below,
In the above pic, notice that the Sublist items have smaller bullets when compared to main list.
- Create a nested list. If you need help in creating, please refer to How to create nested list?
- For sub list, give style list-style: none;
- So you will get the below output after removing the list style
- Now we have to add bullets which are in smaller size than the default one,
- We are going to use pseudo element.
- <li> should be relatively positioned and then pseudo element can be absolutely positioned in relative to the list item.
- So for the li element give position as relative,
- Now we have to use the "before" pseudo element.
Thus the expected result is achieved.
We can change the size of bullet further by changing font-size, top, left attributes.
Size of the bullets are increased.
- Create a nested list. If you need help in creating, please refer to How to create nested list?
- For sub list, give style list-style: none;
- So you will get the below output after removing the list style
- Now we have to add bullets which are in smaller size than the default one,
- We are going to use pseudo element.
- <li> should be relatively positioned and then pseudo element can be absolutely positioned in relative to the list item.
- So for the li element give position as relative,
- Now we have to use the "before" pseudo element.
We can change the size of bullet further by changing font-size, top, left attributes.
Size of the bullets are increased.
Comments
Post a Comment