Lists help organize information clearly. Using styles like unstyled or inline changes how lists look to fit your page design.
List styles (unstyled, inline) in Bootsrap
<ul class="list-unstyled"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> <ul class="list-inline"> <li class="list-inline-item">Item 1</li> <li class="list-inline-item">Item 2</li> <li class="list-inline-item">Item 3</li> </ul>
list-unstyled removes default bullets and left padding from the list.
list-inline makes list items display side by side horizontally. Each item needs list-inline-item class.
<ul class="list-unstyled"> <li>Apple</li> <li>Banana</li> <li>Cherry</li> </ul>
<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 class="list-inline"> <li class="list-inline-item">One</li> </ul>
<ul class="list-unstyled"> </ul>
This page shows two lists: one without bullets and one with items side by side. It uses Bootstrap classes to style them.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Bootstrap List Styles Example</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" /> </head> <body> <main class="container mt-4"> <section> <h2>Unstyled List</h2> <ul class="list-unstyled"> <li>Milk</li> <li>Bread</li> <li>Eggs</li> </ul> </section> <section class="mt-4"> <h2>Inline List</h2> <ul class="list-inline"> <li class="list-inline-item">Home</li> <li class="list-inline-item">Services</li> <li class="list-inline-item">Contact</li> </ul> </section> </main> </body> </html>
The list-unstyled class removes bullets and left padding but keeps vertical stacking.
The list-inline class requires each <li> to have list-inline-item to display horizontally.
Use unstyled lists when you want a simple vertical list without decoration.
Use inline lists for horizontal menus or when space is limited horizontally.
Use list-unstyled to remove bullets and indentation from vertical lists.
Use list-inline with list-inline-item on each item to display list items horizontally.
These styles help make lists fit better in different parts of your webpage like menus or clean content sections.
Practice
list-unstyled do to a list?Solution
Step 1: Understand the purpose of
This class removes the default bullet points and indentation from vertical lists, making them plain.list-unstyledStep 2: Compare with other list styles
Unlikelist-inline, which arranges items horizontally,list-unstyledkeeps items vertical but without bullets.Final Answer:
Removes bullets and indentation from the list -> Option CQuick Check:
list-unstyled= no bullets [OK]
- Confusing
list-unstyledwith horizontal layout - Thinking it adds numbers instead of removing bullets
- Assuming it changes colors or fonts
Solution
Step 1: Identify the required classes for horizontal lists
Bootstrap requireslist-inlineon the<ul>andlist-inline-itemon each<li>to display items inline.Step 2: Check each option for correct usage
- Item 1
- Item 2
list-inlineto<ul>andlist-inline-itemto each<li>. Others miss one or both classes.Final Answer:
Uses both required classes correctly -> Option DQuick Check:
Horizontal list =list-inline+list-inline-item[OK]
list-inline and list-inline-item [OK]- Forgetting
list-inline-itemon<li> - Applying
list-inline-itemto<ul>instead - Using only
list-unstyledfor 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>
Solution
Step 1: Analyze the classes used
Thelist-inlineclass on<ul>andlist-inline-itemon<li>make the list items display horizontally.Step 2: Understand the visual effect
Items appear side by side without bullets or numbers, forming a horizontal list.Final Answer:
A horizontal list with items side by side -> Option AQuick Check:
list-inline+list-inline-item= horizontal list [OK]
- Expecting bullets or vertical stacking
- Confusing with
list-unstyledeffect - Thinking it creates a numbered list
<ul class="list-inline-item"> <li>Home</li> <li>About</li> </ul>
Solution
Step 1: Check where
This class must be on eachlist-inline-itemshould be applied<li>to make items inline, not on the<ul>.Step 2: Identify the correct class for
The<ul><ul>should havelist-inlineclass to enable inline display.Final Answer:
Thelist-inline-itemclass should be on<li>elements, not<ul>-> Option AQuick Check:
list-inline-itembelongs on<li>[OK]
list-inline-item on <li>, not <ul> [OK]- Applying
list-inline-itemto<ul> - Forgetting
list-inlineon<ul> - Confusing with
list-unstyledusage
Solution
Step 1: Remove bullets for a clean vertical list
Applyinglist-unstyledremoves bullets and indentation from the vertical list.Step 2: Make list horizontal on small screens only
Uselist-inline-itemon<li>combined with responsive utilities (liked-sm-inline) to switch layout based on screen size.Step 3: Combine classes for responsive behavior
Bootstrap does not provide a direct responsive list-inline class, so combininglist-unstyledwith inline items and responsive display classes achieves the goal.Final Answer:
Uselist-unstyledon<ul>andlist-inline-itemon<li>with responsive utilities -> Option BQuick Check:
Combine unstyled + inline-item + responsive classes [OK]
- Using only
list-inlinewithout removing bullets - Applying inline classes without responsive utilities
- Expecting Bootstrap to handle responsive inline lists automatically
Ready to prove it?
Pass the test and this pattern moves unknown
