HTML Elements

z


Elements are the basic structure for HTML markup. Elements have two basic properties: attributes and content. Each attribute and each element's content has certain restrictions that must be followed for an HTML document to be considered valid. An element usually has a start label (e.g. <label>) and an end label (e.g. </label>). The element's attributes are contained in the start label and content is located between the labels (e.g. <label>Content</label>). Some elements, such as
, will never have any content and do not need closing labels. Listed below are several types of markup elements used in HTML.

Structural markup describes the purpose of text. For example, <h2>Ball</h2> establishes "Ball" as a second-level heading, which would be rendered in a browser in a manner similar to the "HTML markup" title at the start of this section. A blank line is included after the header. Structural markup does not denote any specific rendering, but most web browsers have standardized on how elements should be formatted. Further styling should be done with Cascading Style Sheets (CSS).

Presentational markup describes the appearance of the text, regardless of its function. For example <b>boldface</b> indicates that visual output devices should render "boldface" in bold text, but has no clear semantics for aural devices that read the text aloud for the sight-impaired. In the case of both <b>bold</b> and <i>italic</i> there are elements which usually have an equivalent visual rendering but are more semantic in nature, namely <strong>strong emphasis</strong> and <em>emphasis</em> respectively. It is easier to see how an aural user agent should interpret the latter two elements. However, they are not equivalent to their presentational counterparts: it would be undesirable for a screen-reader to emphasize the name of a book, for instance, but on a screen such a name would be italicized. Most presentational markup elements have become deprecated under the HTML 4.0 specification, in favor of CSS based style design.

Hypertext markup links parts of the document to other documents. HTML up through version XHTML 1.1 requires the use of an anchor element to create a hyperlink in the flow of text: <a>HTML Online Learning</a>. However, the href attribute must also be set to a valid URL so for example the HTML code, <a href="http://html-online-learning.blogspot.com/">HTML Online Learning</a>, will render these sentence "HTML Online Learning" as a hyperlink.

 

© New Blogger Templates | Webtalks