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 trialS.M.Mohieminul Hossain
3,329 PointsHTML Tag
Are html tags case sensitive?
3 Answers
Ted Sumner
Courses Plus Student 17,967 PointsDave 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.
Petar Popovic
Courses Plus Student 23,421 PointsYes, they are :)
S.M.Mohieminul Hossain
3,329 PointsThank you Petar
Dave Berning
17,365 PointsHTML 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 ;)
S.M.Mohieminul Hossain
3,329 PointsThank you Dave
S.M.Mohieminul Hossain
3,329 PointsS.M.Mohieminul Hossain
3,329 PointsThank you Ted