We now have a youtube channel. Subscribe!

Html Attributes 2


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:

ValueMeaning
ltrLeft to right (the default value)
rtlRight 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>

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>

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

AttributeOptionsFunction
alignright, left, centerHorizontally aligns tags
valigntop, middle, bottomVertically aligns tags within an HTML element.
bgcolornumeric, hexidecimal, RGB valuesPlaces a background color behind an element
backgroundURLPlaces a background image behind an element
idUser DefinedNames an element for use with Cascading Style Sheets.
classUser DefinedClassifies an element for use with Cascading Style Sheets.
widthNumeric ValueSpecifies the width of tables, images, or table cells.
heightNumeric ValueSpecifies the height of tables, images, or table cells.
titleUser 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.

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.
© 2023 ‧ WebDesignTutorialz. All rights reserved. Developed by Jago Desain