8
8
"boldface" in bold text, but gives a little indication what devices that are unable
to do this (such as aural devices that read the text aloud) should do. In the case
of both <b>bold text</b> and <i>italic text</i>, there are other elements that may
have equivalent visual renderings but that are more semantic in nature, such as
<strong>strong text</strong> and <em>emphasized text</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 using CSS for
styling.
Hypertext markup makes parts of a document into links to other documents
An anchor element creates a hyperlink in the document and its href attribute sets
the link's target URL. For example, the HTML markup <a
href="https://en.wikipedia.org/">Wikipedia</a>, will render the word "Wikipedia" as
a hyperlink. To render an image as a hyperlink, an img element is inserted as
content into the a element. Like br, img is an empty element with attributes but no
content or closing tag. <a href="https://example.org"><img src="image.gif"
alt="descriptive text" width="50" height="50" border="0"></a>.
Attributes
Main article: HTML attribute
Most of the attributes of an element are name–value pairs, separated by = and
written within the start tag of an element after the element's name. The value may
be enclosed in single or double quotes, although values consisting of certain
characters can be left unquoted in HTML (but not XHTML).[75][76] Leaving attribute
values unquoted is considered unsafe.[77] In contrast with name-value pair
attributes, there are some attributes that affect the element simply by their
presence in the start tag of the element,[7] like the ismap attribute for the img
element.[78]
There are several common attributes that may appear in many elements :