Thursday, May 25, 2017

Html Attributes 2

Hello guys, good morning. Its realy been a while i posted any thing here. In my last tutorial i talked about HTML attributes and the core attributes, in this tutorial am gonna round up with HTML attributes.

Internationalization Attributes

In HTML, there  are three (3) internationalization attribute, which are available for most (although not all) XHTML elements.

You can also read our tutorial post on: Html Tags


The dir Attribute

The dir attribute allows you to indicate to the browser about the direction in which the text should flow in the HTML page. The dir attribute can take one or two values, as you can see below:

ltrLeft to right (the default value)
rtlRight to left (for languages such as Hebrew or Arabic that are read right to left)


<!DOCTYPE html>
<html dir="rtl">

            <title>Direction Display</title>

            This is how HTML displays text direction                       


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 only 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.


<DOCTYPE html>
<html lang="en">

            <title>English Language Page</title>

            This HTML page is using English Language                 


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

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.

This is it for this tutorial, i believe we done with HTML attributes. Feel free to ask questions via the comment box if you dont understand any thing. In my next tutorial i will talk about HTMl formating. Bye for now


Post a Comment