SA-21/06, C-11, Asapur, Varanasi, UP support@kamaldnp.com +91 8318013442
CSS
1. CSS Tutorial for Beginners — Learn CSS from Scratch 2. CSS Syntax Explained — Selectors, Properties & Values 3. CSS Selectors Tutorial — Class, ID, Attribute & More 4. How to Add CSS to HTML — Inline, Internal, External 5. CSS Colors Tutorial — HEX, RGB, RGBA, HSL Explained 6. CSS Backgrounds Tutorial — Images, Size & Position 7. CSS Borders Tutorial — Style, Width, Radius & Shadow 8. CSS Margin Explained — Shorthand, Auto & Collapse 9. CSS Padding Explained — Shorthand & Margin Difference 10. CSS Height and Width — px, %, em, rem, vw, vh Units 11. CSS Box Model Explained — Content, Padding, Border 12. CSS Text Styling Tutorial — Color, Align & Spacing 13. CSS Fonts Tutorial — font-family, Sizes & Google Fonts 14. CSS Link Styling — Hover, Visited, Active & Buttons 15. CSS Lists Styling — Markers, Counters & Shorthand 16. CSS Tables Styling — Zebra Stripes & Hover Rows 17. CSS Display Property — Block, Inline, None Explained 18. CSS Position Explained — Relative, Absolute, Fixed 19. CSS Overflow Explained — Hidden, Scroll, Auto & More 20. CSS Float and Clear — Layouts & Clearfix Trick 21. CSS Pseudo-classes — Hover, Focus, nth-child & More 22. CSS Pseudo-elements — ::before, ::after & ::first-line 23. CSS Form Styling — Inputs, Labels & Buttons Tutorial 24. CSS Navigation Bar Tutorial — Dropdown Menu Included 25. CSS Website Layout Tutorial — Header, Sidebar, Footer 26. CSS Flexbox Tutorial — Complete Guide with Examples 27. CSS Grid Tutorial — Columns, Rows & Layouts Guide 28. CSS Responsive Design — Media Queries Tutorial 29. CSS Transitions & Animations — No JavaScript Needed 30. CSS Variables Tutorial — :root, var() & Theming 31. CSS Transforms Explained — Rotate, Scale, Translate 32. CSS Filters Tutorial — Blur, Grayscale, Sepia & More 33. CSS Text Effects — Shadows, Wrapping & Overflow 34. CSS Keyframes Tutorial — Bouncing Ball Animation 35. CSS Grid Template Areas — Layout in Words, Not Numbers
Final Test — Certificate ₹10
Try this code live
Lesson 15 of 35

CSS Lists Styling — Markers, Counters & Shorthand

4 min read · Free · No login needed

HTML gives you two kinds of lists — <ul> with bullets and <ol> with numbers. CSS decides what those bullets and numbers look like, where they sit, and whether they appear at all. A navigation menu is really just a list with its bullets removed.

Diagram — see how it fits together
Diagram: CSS Lists

list-style-type — which marker

list-style-type chooses the marker. For unordered lists: disc (a filled circle, the default), circle (an empty circle), square, or none (no marker at all). For ordered lists: decimal (1, 2, 3), lower-alpha (a, b, c), upper-alpha (A, B, C), lower-roman (i, ii, iii) or upper-roman (I, II, III).

list-style-position — inside or outside

list-style-position: outside; (the default) puts the marker outside the text, so wrapped lines line up under the text, not under the marker. inside pulls the marker into the text flow, so wrapped lines start under the marker. Outside looks tidier for most lists; inside is handy for narrow boxes.

list-style-image — a picture marker

list-style-image: url("tick.png"); replaces the bullet with a picture. It sounds fun, but the picture cannot be resized and its position is hard to control, so most developers use a background image or the ::marker pseudo-element instead.

Syntax — lists in action

ul.tasks {
  list-style-type: square;
  list-style-position: inside;
}
ol.toppers {
  list-style-type: upper-roman;
}
ul.menu {
  list-style: none;
  padding: 0;
}

The last rule is the shorthand: list-style sets type, position and image in one line — list-style: square inside url("tick.png");. Any value you leave out simply stays at its default.

Counters — your own numbers

CSS counters let you number things yourself, in your own style. Reset a counter on the list, add one on each item, and print it with content:

ol.steps {
  list-style: none;
  counter-reset: step;
}
ol.steps li::before {
  counter-increment: step;
  content: "Step " counter(step) ": ";
  font-weight: bold;
}

Each item now begins with "Step 1:", "Step 2:" and so on — and if you reorder the items, the numbers follow automatically.

Note: Put list-style-type on the <ul> or <ol>, not on the <li>. It works on both, but setting it once on the list keeps the whole list consistent.
Tip: A navigation menu is a <ul> with list-style: none; and padding: 0; — remove the bullets and the default left padding, and the list becomes a clean row of links.

Common mistakes

  • Removing the bullets with list-style: none; but forgetting the default left padding — the list still sits indented. Add padding: 0;.
  • Setting list-style-type on every <li> instead of once on the list.
  • Using a big picture as a list-style-image — it cannot be resized and often looks huge next to the text.
  • Using an ordered list when the order does not matter — if the sequence is meaningless, use <ul>.

Remember

  • list-style-type picks the marker: disc, circle, square, none, decimal, lower-alpha, upper-roman.
  • outside (default) keeps wrapped lines lined up under the text; inside pulls the marker in.
  • list-style: none; padding: 0; turns a list into a clean menu.
  • The list-style shorthand is type, position, image — in any order.
  • CSS counters (counter-reset, counter-increment, content) print your own numbers.

Example explained

  • ul.tasks { list-style-type: square; } — today's tasks get square bullets instead of round ones, so they look like a checklist.
  • ul.tasks { list-style-position: inside; } — the squares sit inside the text flow, so a long task that wraps to a second line starts under the square.
  • ol.toppers { list-style-type: upper-roman; } — the top three students are numbered I, II, III in Roman numerals, which suits a merit list.
  • ul.menu { list-style: none; padding: 0; } — the menu list loses its bullets and its default left padding, leaving a clean row of links.
  • .tasks li { padding: 6px; } — a little space inside each task item, so the list does not look cramped.
  • .menu li { display: inline; } — each menu item sits on the same line as the next, turning the vertical list into a horizontal menu.

Example

Example
<!DOCTYPE html>
<html>
<head>
<title>Lists - School Day</title>
<style>
ul.tasks { list-style-type: square; list-style-position: inside; }
ol.toppers { list-style-type: upper-roman; }
ul.menu { list-style: none; padding: 0; }
.tasks li { padding: 6px; }
.menu li { display: inline; margin-right: 12px; }
</style>
</head>
<body>

<h2>Today's Tasks</h2>
<ul class="tasks">
<li>Revise CSS padding</li>
<li>Finish the timetable project</li>
<li>Submit the maths homework</li>
</ul>
<h2>Class Toppers</h2>
<ol class="toppers">
<li>Ananya Sharma</li>
<li>Rohan Verma</li>
<li>Priya Singh</li>
</ol>
<ul class="menu">
<li>Home</li>
<li>Courses</li>
<li>Contact</li>
</ul>

</body>
</html>

Output

Output — how it looks in the browser
Output of CSS Lists Styling — Markers, Counters & Shorthand

Try it yourself — live editor

Change the code below and press Run to see the result instantly. No file to save, no login needed.

Result

Frequently asked questions

The questions learners ask most about this lesson — read the question, then open it to see the answer.

1. How do you turn a list into a navigation menu?

With list-style: none; padding: 0; — that removes the bullets and the default indent.

2. What is the difference between inside and outside markers?

outside, the default, keeps wrapped lines lined up under the text; inside pulls the marker into the text.

3. What order does the list-style shorthand use?

Type, position, image — in any order.

Why learn this yourself — and not just ask AI?

AI can write code for you, but it cannot think for you. When you learn HTML yourself, your brain builds the real skill: you understand why a page looks the way it does, you can fix it when it breaks, and you can answer it in an exam or an interview without help. That is the skill that gets you a job — not a copied answer.

Get certified — just ₹10

Finish all 35 lessons, pass the test (80%), pay ₹10 and get your certificate.

Take the test

Prefer watching? Video courses teach the same topics step by step.

Go further with a full course

Free tutorials teach you the basics. Our paid courses add live projects, mentorship and a certificate.

Website Design Using WordPress 3 Days (Basic to Advanced)
₹199
View
Core Python Programming – 3 Month Complete Course
₹700
View
AI Prompt Engineering Webinar 2026
View
Browse all courses
CSS — Lessons
1. CSS Tutorial for Beginners — Learn CSS from Scratch 2. CSS Syntax Explained — Selectors, Properties & Values 3. CSS Selectors Tutorial — Class, ID, Attribute & More 4. How to Add CSS to HTML — Inline, Internal, External 5. CSS Colors Tutorial — HEX, RGB, RGBA, HSL Explained 6. CSS Backgrounds Tutorial — Images, Size & Position 7. CSS Borders Tutorial — Style, Width, Radius & Shadow 8. CSS Margin Explained — Shorthand, Auto & Collapse 9. CSS Padding Explained — Shorthand & Margin Difference 10. CSS Height and Width — px, %, em, rem, vw, vh Units 11. CSS Box Model Explained — Content, Padding, Border 12. CSS Text Styling Tutorial — Color, Align & Spacing 13. CSS Fonts Tutorial — font-family, Sizes & Google Fonts 14. CSS Link Styling — Hover, Visited, Active & Buttons 15. CSS Lists Styling — Markers, Counters & Shorthand 16. CSS Tables Styling — Zebra Stripes & Hover Rows 17. CSS Display Property — Block, Inline, None Explained 18. CSS Position Explained — Relative, Absolute, Fixed 19. CSS Overflow Explained — Hidden, Scroll, Auto & More 20. CSS Float and Clear — Layouts & Clearfix Trick 21. CSS Pseudo-classes — Hover, Focus, nth-child & More 22. CSS Pseudo-elements — ::before, ::after & ::first-line 23. CSS Form Styling — Inputs, Labels & Buttons Tutorial 24. CSS Navigation Bar Tutorial — Dropdown Menu Included 25. CSS Website Layout Tutorial — Header, Sidebar, Footer 26. CSS Flexbox Tutorial — Complete Guide with Examples 27. CSS Grid Tutorial — Columns, Rows & Layouts Guide 28. CSS Responsive Design — Media Queries Tutorial 29. CSS Transitions & Animations — No JavaScript Needed 30. CSS Variables Tutorial — :root, var() & Theming 31. CSS Transforms Explained — Rotate, Scale, Translate 32. CSS Filters Tutorial — Blur, Grayscale, Sepia & More 33. CSS Text Effects — Shadows, Wrapping & Overflow 34. CSS Keyframes Tutorial — Bouncing Ball Animation 35. CSS Grid Template Areas — Layout in Words, Not Numbers
Final Test — Certificate ₹10

🤖 KAMALDNP AI Assistant

Ask about courses, website & more

Hi! I'm KAMALDNP AI Assistant. Ask me about our courses, website features, or anything else! 😊
Please wait 5s...
🤖 KAMALDNP Assistant ✕

Request human callback:

🔐 Login Required
✕

Please log in to download. You will stay on this page after logging in!

New here? Register now →