Performance: List styles (unstyled, inline)
This affects how quickly the browser can render lists by controlling default styles and layout behavior.
<ul class="list-inline"><li class="list-inline-item">Home</li><li class="list-inline-item">About</li><li class="list-inline-item">Contact</li></ul>
<ul><li>Home</li><li>About</li><li>Contact</li></ul>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Default <ul> with bullets | Minimal | 2 reflows (bullets + vertical stacking) | Medium paint cost | [X] Bad |
| Inline list with Bootstrap classes | Minimal | 1 reflow (inline layout) | Low paint cost | [OK] Good |
| Unstyled list with inline styles | Minimal | 1 reflow (padding removal) | Medium paint cost | [OK] Good |
| Unstyled list with Bootstrap class | Minimal | 0 reflows | Low paint cost | [OK] Good |
list-unstyled do to a list?list-unstyledlist-inline, which arranges items horizontally, list-unstyled keeps items vertical but without bullets.list-unstyled = no bullets [OK]list-unstyled with horizontal layoutlist-inline on the <ul> and list-inline-item on each <li> to display items inline.list-inline to <ul> and list-inline-item to each <li>. Others miss one or both classes.list-inline + list-inline-item [OK]list-inline and list-inline-item [OK]list-inline-item on <li>list-inline-item to <ul> insteadlist-unstyled for horizontal layout<ul class="list-inline"> <li class="list-inline-item">Apple</li> <li class="list-inline-item">Banana</li> <li class="list-inline-item">Cherry</li> </ul>
list-inline class on <ul> and list-inline-item on <li> make the list items display horizontally.list-inline + list-inline-item = horizontal list [OK]list-unstyled effect<ul class="list-inline-item"> <li>Home</li> <li>About</li> </ul>
list-inline-item should be applied<li> to make items inline, not on the <ul>.<ul><ul> should have list-inline class to enable inline display.list-inline-item class should be on <li> elements, not <ul> -> Option Alist-inline-item belongs on <li> [OK]list-inline-item on <li>, not <ul> [OK]list-inline-item to <ul>list-inline on <ul>list-unstyled usagelist-unstyled removes bullets and indentation from the vertical list.list-inline-item on <li> combined with responsive utilities (like d-sm-inline) to switch layout based on screen size.list-unstyled with inline items and responsive display classes achieves the goal.list-unstyled on <ul> and list-inline-item on <li> with responsive utilities -> Option Blist-inline without removing bulletsPass the test and this pattern moves unknown