Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Beginning HTML and CSS Introduction to HTML and the Portfolio Project

HTML Tag

Are html tags case sensitive?

3 Answers

Dave your example is true, but I think misleading. HTML is case sensitive, but in your markup your open and closing tags are all the same case and thus follow the case sensitive rules. A capital letter is not the same as a lower case letter.

<!-- This is valid markup -->
<Body>code here</Body>

<!-- This is NOT valid markup -->
<Body>code here</bOdy>
<body>code here</Body>
<BODY>code here</body>

HTML, CSS, PHP, and CSS are all case sensitive. This != this.

And case matters in the Treehouse quizzes. One of the early quizzes rejects Javascript because the proper answer is JavaScript.

Thank you Ted

Yes, they are :)

Thank you Petar

Dave Berning
Dave Berning
17,365 Points

HTML tags are NOT case sensitive; they are case INsensitive. You can mix and match which case you use when writing your markup.

<!-- This is valid markup -->
<h1>Treehouse Blog</h1>

<!-- This is also valid markup -->
<H1>Treehouse Blog</H1>

However, it's best practice is to use all lowercase. Using all caps is frowned upon and terrible for readability.

Programming languages like JavaScript are definitely case sensitive ;)

Thank you Dave