HTML is case insensitive but which one is more preferable? <html>, <HTML> or <hTmL> | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

HTML is case insensitive but which one is more preferable? <html>, <HTML> or <hTmL>

I have seen people writing html tags in uppercase and lowercase. To me lowercase look nice. Which one do you recommend?

3rd May 2017, 4:05 PM
Wisdom Abioye
Wisdom Abioye - avatar
7 Answers
+ 22
Lowercase should be preferred because according to me, it gives a cleaner look to our code. And now after getting basic knowledge of other programming languages, I always write HTML code in lowercase.
3rd May 2017, 4:19 PM
Biraj Patel
+ 5
lowercase is more common, also it may cause confusion for others when they read your code.
3rd May 2017, 6:38 PM
keivan Ipchi
keivan Ipchi - avatar
+ 4
my first book about html taught the tags and attributes in uppercase, but the values of the attributes in lowercase. I prefer lowercase though, because it's easier to write and read than uppercase.
3rd May 2017, 5:38 PM
Mario L.
Mario L. - avatar
+ 3
Lowercase is what I have encountered most. But as you said, HTML is case insensitive, so it doesn't matter whether lower- or uppercase. BUT whatever style you choose, be CONSISTENT, i.e. if you choose lowercase, then stick to it. Hope that helps. Happy coding! ;)
3rd May 2017, 4:50 PM
Thanh Le
Thanh Le - avatar
+ 1
just lowercase. It's a bad habit to use uppercase/camelcase on html tags. It's case insensitive but sometimes some errors can come up
3rd May 2017, 4:10 PM
Welliton Malta
Welliton Malta - avatar
+ 1
i recommend lowercase :)
3rd May 2017, 4:17 PM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
+ 1
<html lang="en" dir="ltr"></html>
2nd May 2021, 5:56 AM
X-Factor Gamer Akshay
X-Factor Gamer Akshay - avatar