What Should Be Avoided
Scenario: A webpage is intended for French-speaking users, but the language is not properly defined in the HTML code.
HTML/CSS
<!doctype html> <html lang="fr"> <head> <meta charset="utf-8"> <title>document écrit en français</title> </head> <body> ... document écrit en français ... </body> </html>
Explanation:Without the lang attribute, screen readers, text-to-speech AT, and browsers cannot determine the language of the page, which may lead to incorrect pronunciation and rendering issues.