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

There  are three internationalization attribute, which are available for most (although not all) XHTML elements.


dir
lang
xml:lang


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:

Value                                                         Meanng

ltr                                   Left  to right (the default direction)

rtl                                   Right to left (for languages like 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.

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.

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.

Generic Attributes

Attribute                          Option                                                     Function

align                            right, left, center      
                                    Horizontally aligns tags


Valign                          top, middle, bottom                                    
                                    Vertically aligns tags

bgcolor                        numeric, hexidecimal, RGB values            
                                    place a background color

id                                 user defined                                               
                                    Names an element for use with CSS

class                            user defined                                          
                                    Classifies an element for use with CSS

width                           Numeric Value                                       
                                    Specifies the width of an element

height                          Numeric Value                                        
                                    Specifies the height of an element

title                              user defined                                            
                                    Pop-up title of the element


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

Links to previous tutorials on HTML : Html IntroductionHtml TagsHtml Document StructureThe Doctype Declaration , Html Basic Tags , Html Basic Tags2 , Html Elements , Html Attributes
Share:

0 comments:

Post a Comment