-
Hajipur, Bihar, 844101
HTML lists like <ul>
, <ol>
, and <li>
can be styled using CSS to change:
Bullet styles
List spacing
Positioning
Custom icons
List layout (horizontal/vertical)
Unordered List (<ul>
) – Bulleted list
Ordered List (<ol>
) – Numbered list
List Item (<li>
) – List item inside ul/ol
Use list-style-type
to change bullets or numbering.
ul {
list-style-type: square;
}
ol {
list-style-type: upper-roman;
}
🔹 Common Values:
disc
, circle
, square
, none
(for <ul>
)
decimal
, lower-alpha
, upper-roman
, lower-greek
(for <ol>
)
ul {
list-style-type: none;
}
This is often used in nav menus.
ul {
list-style-position: inside;
}
Values:
outside
(default)
inside
(bullets/number appear inside content box)
ul {
list-style-image: url('checkmark.png');
}
ul li {
display: inline;
margin-right: 20px;
}
Great for nav menus or toolbars.
list-style
ul {
list-style: square inside;
}
Same as:
list-style-type: square;
list-style-position: inside;
Q1. Change bullet style of a <ul>
to circle
.
Q2. Change number style of an <ol>
to uppercase Roman.
Q3. Remove bullets from a list.
Q4. Set list markers inside the list content.
Q5. Apply a custom image as bullet.
Q6. Style list items to appear inline with spacing.
Q7. Combine list-style-type
and list-style-position
using shorthand.
Q8. Set a different bullet style for two <ul>
lists.
Q9. Use lower-alpha
for an ordered list.
Q10. Make a vertical navigation menu without bullets.
Q1: Which property sets the type of list marker?
Q2: How do you remove bullets from a list?
Q3: What does list-style-position: inside; do?
Q4: Which value displays numbers as uppercase Roman numerals?
Q5: How to use an image as a list marker?
Q6: What does list-style: square inside; mean?
Q7: Which display makes list items appear in one line?
Q8: Which list style type is default for <ul>?
Q9: What is the correct shorthand for all list styles?
Q10: Can list-style-image be used with ordered lists?