What Should Be Avoided
Scenario: An English webpage includes French phrases but does not specify the language programmatically.
HTML/CSS
<!doctype html> <html lang="en-GB"> <head> <meta charset="utf-8"> <title>WCAG Blog</title> </head> <body> <p>She has a certain <em>je ne sais quoi</em> that makes her unique.</p> </body> </html>
Explanation:Without the lang attribute, assistive technologies may struggle to pronounce "je ne sais quoi" correctly according to French pronunciation rules, potentially causing confusion for users relying on screen readers.