There are a few attributes that are considered "core attributes" because they can be applied to nearly every element. They are:
dirIt can take the values
rtlorltrwhich stand for right-to-left and left-to-right. This attribute specifiesbase direction of directionally neutral text (i.e., text that doesn't have inherent directionality as defined in Unicode). It also specifies the directionality of tables.
Source: W3C.Example:
<p dir="rtl">The quick brown fox</p>In this example, the text is aligned to the right in the same way thattext-align:rightwould. This attribute is inherited by child elements.This attribute can be applied to all elements except
applet,base,basefont,bdo,br,frame,frameset,iframe,param,script.classA class is a name under which multiple (X)HTML elements can be grouped for the purpose of styling using CSS or scripting using Javascript. A single element can be associated with multiple classes, each class name being separated by spaces.
Example:
<p class="products floated">the quick brown fox jumps</p>In the above example, the
pbelongs to two classes:productsandfloated.The class attribute can be applied to all elements except
base,basefont,head,html,meta,param,script,style,title.idAn
idis a name assigned to a single element in an (X)HTML document for the purpose of styling using CSS and scripting using Javascript and it is also used for creating fragments. An element can have only oneid. No two elements should have the sameidvalue.Example:
<p id="tagline">the quick brown fox</p>The
idattribute can be applied to all elements exceptbase,head,html,meta,script,style,title.langThe
langattribute identifies the language (human languages, not computer languages) of the text content and attribute values of an element. The language is specified using a two-letter code specified in ISO 639-1. Thelangattribute helps screen readers to pronounce words correctly, helps browsers to choose the correct fonts and the punctuation such as correct quotation marks, and helps search engines to identify the language of a web page.Example:
<p>The French word for apple is <span lang="fr">pomme</span>.</p>This attribute can be applied to any element except
applet,base,basefont,br,frame,frameset,iframe,param,script.This attribute is inherited by child elements. The
langattribute is often applied to thehtmlelement to specify the language of the document.xml:langThis attribute is similar to the
langattribute, but is used only in XHTML documents.Example:
<p xml:lang="fr">Bonjour! Comment allez-vous?</p>styleThe
styleattribute is used to apply CSS a rule to an element. The value of thestyleattribute is one or more CSS declarations separated by semicolons and, optionally, spaces. Curly brace limiters ({ and }) are not allowed. It cannot contain CSS selectors.The CSS declarations in the style attribute have the highest specificity and are known as inline styles.
Example:
<p style="background-color:navajowhite;color:indianred">the quick brown fox</p>The
styleattribute can be applied to all elements exceptbase,basefont,head,html,meta,param,script,style,title.titleThe
titleattribute contains additional information about an element. If the element is displayed, browsers display the value of thetitleattribute as a tool tip when the mouse hovers over it.Example:
<p><img src="photo1.jpg" alt="Photo of the Himalayas"></p>The
titleattribute can be applied to all elements exceptbase,basefont,head,html,meta,param,script,title.



No comments:
Post a Comment