Content · Web Development · HTML

HTML Case Sensitivity and Coding Conventions

HTML element names are usually handled without regard to case, so P and p are understood the same way in regular HTML markup. Lowercase remains the normal style because it is easier to scan.

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

HTML element names are usually handled without regard to case, so P and p are understood the same way in regular HTML markup. Lowercase remains the normal style because it is easier to scan.

What You Need to Know


Do not assume every attribute value ignores case: IDs, class names used by scripts and CSS, file paths, and many tokens have their own rules.

In ordinary HTML documents, element and attribute names are ASCII case-insensitive. Lowercase is still the easiest convention to read and maintain.

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.

<SECTION>
    <H2>School News</H2>
    <P>This works, but lowercase is easier to read.</P>
</SECTION>

Let’s Understand the Example


  • Section groups content around a shared topic and usually has a heading.
  • An h2 starts a major section beneath the page topic.
  • A p groups a paragraph of related text. Start another paragraph for a new thought.

You should see a readable heading and its related content. The heading level tells readers how the ideas fit together, not merely how large the letters look.

What Should You See?


The page should display “School News” as a heading, followed by its related content. Change the heading text and refresh the browser to see the result.

Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.

Try It Yourself


  1. Rewrite the uppercase example using consistent lowercase element and attribute names.
  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


  • Thinking that an uppercase file path always matches a lowercase filename on the server.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • HTML element names are usually handled without regard to case, so P and p are understood the same way in regular HTML markup.
  • Section groups content around a shared topic and usually has a heading.
  • In ordinary HTML documents, element and attribute names are ASCII case-insensitive. Lowercase is still the easiest convention to read and maintain.
Share this resourceSend this page to someone who may find it useful.