Semantic HTML: Difference between revisions

Content deleted Content added
mNo edit summary
Zupanto (talk | contribs)
The meaning of the i tag was changed in HTML5, which made the example rather inadequate. The source for the meaning was outdated.
Line 1:
{{Redirect|Semantic markup|more general usage|separation of content and presentation|semantics in programming languages|Semantics (computer science)}}
'''Semantic HTML''' is the use of [[HTML]] markup to reinforce the [[semantics]], or meaning, of the information in webpages and [[web application]]s rather than merely to define its presentation or look. Semantic HTML is processed by traditional [[web browser]]s as well as by many other [[user agent]]s. [[Cascading Style Sheets|CSS]] is used to suggest its presentation to human users.
 
As an example, recent HTML standards discourage use of the element <code>i</code> ([[italic type|italic]], a [[typeface]])<ref>{{cite web | url=http://www.w3.org/TR/html401/present/graphics.html#h-15.2 | title=Alignment, font styles, and horizontal rules in HTML documents | origyear=2000| year=2002 | publisher=[[W3C]] }}</ref> in preference of more accurate elements such as <code>em</code> (emphasis); the CSS stylesheet should then specify whether emphasis is denoted by an italic font, a bold font, underlining, slower or louder audible speech etc. This is because italics are used for purposes other than emphasis, such as citing a source; for this, HTML 4 provides the element <code>cite</code>.<ref>{{cite web | url=http://www.w3.org/TR/html401/struct/text.html#edef-CITE | title=HTML 4.01 Specification: Phrase elements: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ABBR, and ACRONYM | year=1999 | publisher=[[W3C]] | accessdate=2009-10-18 }}</ref> Another use for italics is foreign phrases or [[loanwords]]; web designers may use built-in XHTML language attributes<ref>{{cite web | url=http://www.w3.org/TR/xhtml1/#C_7 | title=XHTML 1.0 The Extensible HyperText Markup Language (Second Edition): The lang and xml:lang Attributes | origyear=2000| year=2002 | publisher=[[W3C]] | accessdate=2009-10-18 }}</ref> or specify their own semantic markup by choosing appropriate names for the <code>class</code> attribute values of HTML elements (e.g. <code>class="loanword"</code>). Marking emphasis, citations and loanwords in different ways makes it easier for [[User agent|web agents]] such as [[search engine]]s and other software to ascertain the significance of the text.
 
== History ==