menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Software News

>

A Reader’s...
source image

CSS-Tricks

2d

read

377

img
dot

Image Credit: CSS-Tricks

A Reader’s Question on Nested Lists

  • The article addresses a reader's question on styling nested lists using CSS counters.
  • The reader seeks help with a routine numbering sequence across different levels in lists, like legal documents.
  • The article demonstrates solutions for creating nested lists with different markers at each level.
  • One approach involves changing list-style-type for each level using CSS.
  • A more efficient method uses CSS nesting to simplify styling for nested lists.
  • For legal documents requiring specific markers like (A), (ii), custom counter styles using @counter-style at rule are recommended.
  • The @counter-style is used to define custom markers such as decimals without ending dots or alphabetic markers enclosed in parentheses.
  • The type attribute in HTML lists can ensure correct numbering even without CSS support for legal or technical documents.
  • Using type attribute, we can assign specific numbering like decimal, lowercase/uppercase alphabetic, and Roman numbers for each level of the list.
  • The article explores different methods of styling nested lists and provides insights into maintaining numbering consistency.

Read Full Article

like

22 Likes

For uninterrupted reading, download the app