Lang And Dir Attributes - HTML Tutorials - W3resource
Có thể bạn quan tâm
lang and dir attributes of HTML specify language and text direction of an element.
HTML lang attribute
1. lang attribute of HTML sets the language of an element in HTML document. Usage of lang attribute helps the browser to display the text in the desired language.
2. The value of the lang attribute is the language code specified by the W3C to be used with HTML.
Syntax
<ElementName lang="language_code">text content</ElementName>Where ElementName is any HTML element name except applet, base, basefont, br, frame, frameset, iframe, param, script.
Example of using lang attribute
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Example lang attribute - HTML tutorial | w3resource</title> </head> <body> <p lang="en-US">This paragraph is in English.</p> <p lang="es">Este apartado está en español</p> </body> </html>Result
View this example in a separate browser window
Example of lang attribute
HTML dir attribute
Description
1. dir attribute of HTML sets the direction of the text within an element in HTML document.
2. The value of the dir attribute is either ltr (i.e. left to right) or rtl (i.e. right to left).
HTML dir attribute supports All elements but APPLET, BASE, BASEFONT, BDO, BR, FRAME, FRAMESET, IFRAME, PARAM, SCRIPT
Example of using dir attribute
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Example dir attribute - HTML tutorial | w3resource</title> </head> <body> <p dir="ltr" >This text is in left ot right direction.</p> <p dir="rtl">טקסט זה בשטחים השמאלי בכיוון הנכון</p> </body> </html>Result
This text is in left to right direction.
טקסט זה בשטחים השמאלי בכיוון הנכון
View this example in a separate browser window
Example of dir attribute
Note
If you are using a plain text editor like notepad to write right to left text using dir="rtl", you must set the encoding style to UNICODE while saving the file.
Previous: HTML label attribute Next: HTML longdesc attribute
Từ khóa » Html Lang Tr
-
HTML Lang Etiketi Nedir? Nasıl Kullanılır?
-
HTML ISO Language Code Reference - W3Schools
-
HTML Lang Etiketi Kullanımı - UPGO
-
Dr. Mehmet Hilmi Güler On Twitter: " HTML Dil Kodları | M5 Bilişim
-
Lang - HTML: HyperText Markup Language - MDN Web Docs
-
8 Language Information And Text Direction - W3C
-
Kullanılan Etiketinin Lang Niteliği Nedir? - Web-gelistirme
-
HTML Lang Etiketi Nedir? Ne Için Kullanılır? - Yazılım Delisi
-
HTML Lang Etiketi Nedir? Nasıl Kullanılır? - Aramamotoru ... - Pinterest
-
What Is The 'lang' Attribute Of The Tag Used For? - Stack Overflow
-
HTML Lang Attribute / ISO Language Code Reference / Culture Names
-
HTML5 Lang Ve Charset Attributes - Engin Polat