HTML global attributes

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

HTML global attributes:

HTML global attributes

Class attribute:

Class attribute The class attribute specifies one or more classnames for an element. The class attribute is mostly used to point to a class in a style sheet. However , it can also be used by a JavaScript (via the HTML DOM) to make changes to HTML elements with a specified class .

PowerPoint Presentation:

<html > < head > < style type="text/ css "> h1.intro { color:blue ;} p.important { color:green ; } </ style > </ head > < body > < h1 class="intro">Header 1</h1 > < p>A paragraph.</p > < p class =“important” >We are TYCS students learning HTML. </ p > </ body > </ html>

Dir:

Dir The dir attribute specifies the text direction of the element's content. Value Description ltr Default. Left-to-right text direction rtl Right-to-left text direction auto Let the browser figure out the text direction, based on the content (only recommended if the text direction is unknown)

PowerPoint Presentation:

<html> <head> <h1>Testing the DIR attribute</h1> </head> <body> <h1 >Header 1</h1> <p>A paragraph.</p> <p dir=“ rtl ” >We are TYCS students learning HTML. </p> </body> </html>

ID attribute:

ID attribute The id attribute specifies a unique id for an HTML element (the value must be unique within the HTML document). The id attribute is used to point to a style in a style sheet, and by JavaScript to manipulate the element with the specific id.

PowerPoint Presentation:

<html> <head> <script type="text/ javascript "> function displayResult () { document.getElementById (" myHeader "). innerHTML ="Have a nice day!"; } </script> </head> <body> <h1 id=" myHeader ">Hello World!</h1> <button onclick =" displayResult ()">Change text</button> </body> </html>

PowerPoint Presentation:

<html> <head> <style> #t1{ background- image:url (tulips.jpg);} </style> </head> <form> <label for="t1">Submit Query</label> < textarea rows="25" col ="100" id="t1"></ textarea > </input> </form> </html>

LANG:

LANG  the lang attribute can be used on  any  HTML element. The HTML lang attribute can be used to declare the language of a Web page or a portion of a Web page. This is meant to assist search engines and browsers. According to the W3C recommendation you should declare the primary language for each Web page with the lang attribute inside the <html> tag, like this: <html lang ="en"> ... </html>

PowerPoint Presentation:

Language ISO Code Abkhazian ab Afar aa Assamese as Aymara ay Azerbaijani az Bashkir ba Basque eu Bengali (Bangla) bn Bhutani dz Bihari bh

STYLE:

STYLE The style attribute specifies an inline style for an element. The style attribute will override any style set globally, i.e.styles specified in the <style> tag or in an external style sheet. <h1 style=" color:blue;text-align:center ">This is a header</h1> <p style=" color:green ">This is a paragraph.</p>

TITLE:

TITLE The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element. <p title="Free Web tutorials">W3Schools.com</p>

authorStream Live Help