如何在 HTML 中新增多語言內容?
lang 屬性在 HTML 中允許你為英語以外的語言設定內容。你可以嘗試執行以下程式碼來實現lang 屬性。
示例
在此,我們還添加了法語和西班牙語的內容。
<!DOCTYPE html> <html> <body> <h2>English</h2> <p lang="en">This is demo text</p> <h2>French</h2> <p lang="fr">Ceci est un texte de démonstration</p> <h2>Spanish</h2> <p lang="es">Este es un texto de demostración</p> </body> </html>
廣告