Content · Web Development · HTML

HTML HTML Start Tags vs End Tags: When Closing Tags Are Optional

Some HTML end tags are optional in carefully defined situations. For example, the browser can finish one li when the next li begins, but that is not a general rule for every element.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Some HTML end tags are optional in carefully defined situations. For example, the browser can finish one li when the next li begins, but that is not a general rule for every element.

What You Need to Know


Writing explicit closing tags is usually easier for learners and reviewers. Learn the rules to understand old code, not as an excuse to skip structure.

HTML allows certain end tags to be omitted, but only under specific rules. Writing them explicitly is often easier for a beginner to review.

The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.

Example: See It in Action


Here is a simple example to experiment with. Type it, save the file, and check what the browser displays.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<ul>
    <li>Apples
        <li>Bananas
            <li>Pears
            </ul>

Let’s Understand the Example


  • Ul groups items where the order does not matter.
  • Li is one item inside a list. Keep each item inside its parent list.

You should see distinct list items. Ask whether their order carries meaning: if the order matters, use an ordered list; otherwise use an unordered list.

What Should You See?


The page should include “Apples”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.

Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.

Try It Yourself


  1. Add explicit </li> tags and check that the list looks exactly the same.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Believing that all closing tags may be omitted because a browser displayed one short example.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • Some HTML end tags are optional in carefully defined situations.
  • Ul groups items where the order does not matter.
  • HTML allows certain end tags to be omitted, but only under specific rules. Writing them explicitly is often easier for a beginner to review.
Share this resourceSend this page to someone who may find it useful.