Content deleted Content added
m Reverted edits by 140.213.230.205 (talk): editing tests (HG) (3.4.9) |
rv; unexplained poor addition |
||
Line 34:
Usually, [[HTML element]]s can take any of several most common standard attributes ([[#Standard_attributes|See the complete list]]):
* The '''<code>id</code>'''
* The '''<code>class</code>''' attribute provides a way of classifying similar elements.<ref>{{Cite web|url=https://www.w3schools.com/html/html_classes.asp|title=HTML Classes|website=www.w3schools.com|access-date=2020-04-27}}</ref><ref>{{Cite web|url=https://www.w3schools.com/tags/att_global_class.asp|title=HTML Global class Attribute|website=www.w3schools.com|access-date=2020-04-27}}</ref> This can be used for [[semantics|semantic]] purposes, or for presentation purposes. Semantically, for example, classes are used in [[microformat]]s. Presentationally, for example, an HTML document might use the designation <code>class="notation"</code> to indicate that all elements with this class value are subordinate to the main text of the document. Such elements might be gathered together and presented as footnotes on a page instead of appearing in the place where they occur in the HTML source. Another presentation use would be as a [[CSS selector]]. Multiple classes [[Variable_(computer_science)#Naming_conventions|can be added by having spaces between each Identifier]].
* An author may use the '''<code>style</code>''' non-attributal codes presentational properties to a particular element. The '''<code>style</code>''' attribute can be used on any HTML element (it will validate on any HTML element; however, it is not necessarily useful). It is considered better practice to use an element's <code>id</code> or <code>class</code> attributes to select the element with a [[Style sheet (web development)|stylesheet]], though sometimes this can be too cumbersome for a simple and specific or ad hoc application of styled properties.
|