Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

should I change <html lang="en_US"> to <html lang="en">?

Tags:

html

I used to think that if I want to target US audience I should use:

<html lang=en_us>

However, recently I got this message from https://validator.w3.org

Error: Bad value en_US for attribute lang on element html: The language subtag en_us is not a valid language subtag.

So is the en_US totally wrong? I should change all my html tags to en from en_US now?

Any detailed information on this?

like image 947
AGamePlayer Avatar asked Sep 05 '25 16:09

AGamePlayer


1 Answers

So is the en_US totally wrong?

It's not a valid value for that attribute. It should be en-US - valid values.

like image 146
Vucko Avatar answered Sep 07 '25 18:09

Vucko