Hello dear readers! welcome back to another section of my tutorial on Html. In my last tutorial post, i talked about HTML attributes and the core attributes, in this tutorial am going to be rounding up with Html attributes.
Internationalization Attributes
Html has three internationalization attribute, which are available for most (although not all) XHTML elements.
You can also read our tutorial post on: Html Tags
dir
lang
xml:lang
The dir Attribute
The dir attribute allows you to indicate to the web browser about the direction that the text should flow in the Html document. The dir attribute can take one or two values, as you can see below:
Value | Meaning |
---|---|
ltr | Left to right (the default value) |
rtl | Right to left (for languages such as Hebrew or Arabic that are read right to left) |
Example
<!DOCTYPE html>
<html dir="rtl">
<head>
<title>Direction Display</title>
</head>
<body>
This is how HTML displays text direction
</body>
</html>
<html dir="rtl">
<head>
<title>Direction Display</title>
</head>
<body>
This is how HTML displays text direction
</body>
</html>
you can try the above code out using your text editor for better understanding.
You can also read our tutorial post on : Html Attributes
The lang Attribute
The lang attribute allows you to indicate the main language used in a Html document, but this attribute was kept in Html for backwards compatibility with earlier versions of Html. The attribute has been replaced by the xml:lang attribute in new Html documents.
The values of the lang attribute are ISO-639 standard two-character language codes.
Example
<DOCTYPE html>
<html lang="en">
<head>
<title>English Language Page</title>
</head>
<body>
This HTML page is using English Language
</body>
</html>
<html lang="en">
<head>
<title>English Language Page</title>
</head>
<body>
This HTML page is using English Language
</body>
</html>
You can also try that out using your text editor and feel free to ask questions
The xml:lang Attribute
The xml:lang attribute is the XHTML replacement for the lang attribute. The value of the xml:lang attribute should be an ISO-639 country code as mentioned in the previous section.
You can also read our tutorial post on: Html Elements
Generic Attributes
Attribute | Options | Function |
---|---|---|
align | right, left, center | Horizontally aligns tags |
valign | top, middle, bottom | Vertically aligns tags within an HTML element. |
bgcolor | numeric, hexidecimal, RGB values | Places a background color behind an element |
background | URL | Places a background image behind an element |
id | User Defined | Names an element for use with Cascading Style Sheets. |
class | User Defined | Classifies an element for use with Cascading Style Sheets. |
width | Numeric Value | Specifies the width of tables, images, or table cells. |
height | Numeric Value | Specifies the height of tables, images, or table cells. |
title | User Defined | "Pop-up" title of the elements. |
Alright guys! This is where we are rounding up for this tutorial post. In my next tutorial post, we will be studying about Html Formatting.
Feel free to ask your questions where necessary and i will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.
Feel free to ask your questions where necessary and i will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.
Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.
Thanks for reading and bye for now.