List

Represents a <ul> or <ol> element

Usage Notes

  • Place anywhere on a page to create a list

  • Place within the List Item slot to create a nested list

Properties

  • Tag. Enter ul or ol

  • List Items ( Slot ). Place list items here

Styling

Here’s what styling an HTML list (<ul>, <ol>, <li>) supports directly or via CSS:

  • List type / bullet style:

    • list-style-type

      • disc β†’ ●

      • circle β†’ β—‹

      • square β†’ β– 

      • decimal β†’ 1. 2. 3.

      • lower-roman β†’ i. ii. iii.

      • upper-roman β†’ I. II. III.

      • lower-alpha β†’ a. b. c.

      • upper-alpha β†’ A. B. C.

      • none β†’ removes bullets/numbers

  • List image:

    • list-style-image β†’ use a custom image or SVG as bullet

  • List position:

    • list-style-position

      • inside β†’ bullets inside content box

      • outside β†’ bullets outside content box

  • Spacing / layout:

    • margin β†’ space around list

    • padding β†’ space inside list or items

    • line-height β†’ vertical spacing between items

    • gap β†’ spacing between items (in flex or grid contexts)

  • Marker styling (modern CSS):

    • ::marker pseudo-element to style bullet or number:

      • color

      • font-size

      • font-family

      • content (e.g. custom symbols)

ul {
  list-style-type: square;
  margin: 1em;
  padding-left: 2em;
}

li::marker {
  color: red;
  font-size: 1.5em;
  content: "β˜… ";
}
  • Custom numbering (for <ol>):

    • start attribute to set initial number

    • reversed attribute to count backwards

    • CSS counters for fully custom sequences

All of these styles can be applied through CSS, making HTML lists highly customizable.

Last updated