0% found this document useful (0 votes)
4 views1 page

8

The document discusses HTML elements and their attributes, focusing on how visual and semantic elements differ, particularly in terms of accessibility for aural devices. It explains the use of anchor elements for hyperlinks and the importance of attributes like id, class, style, title, and lang in defining and styling HTML elements. The document emphasizes the shift from presentational markup to CSS for styling in HTML 4.0.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

8

The document discusses HTML elements and their attributes, focusing on how visual and semantic elements differ, particularly in terms of accessibility for aural devices. It explains the use of anchor elements for hyperlinks and the importance of attributes like id, class, style, title, and lang in defining and styling HTML elements. The document emphasizes the shift from presentational markup to CSS for styling in HTML 4.0.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

For example, <b>bold text</b> indicates that visual output devices should render

"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 :

The id attribute provides a document-wide unique identifier for an element. This is


used to identify the element so that stylesheets can alter its presentational
properties, and scripts may alter, animate or delete its contents or presentation.
Appended to the URL of the page, it provides a globally unique identifier for the
element, typically a sub-section of the page. For example, the ID "Attributes" in
https://en.wikipedia.org/wiki/HTML#Attributes.
The class attribute provides a way of classifying similar elements. This can be
used for semantic or presentation purposes. For example, an HTML document might
semantically use the designation <class="notation"> to indicate that all elements
with this class value are subordinate to the main text of the document. In
presentation, 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.
Class attributes are used semantically in microformats. Multiple class values may
be specified; for example <class="notation important"> puts the element into both
the notation and the important classes.
An author may use the style attribute to assign presentational properties to a
particular element. It is considered better practice to use an element's id or
class attributes to select the element from within a stylesheet, though sometimes
this can be too cumbersome for a simple, specific, or ad hoc styling.
The title attribute is used to attach a subtextual explanation to an element. In
most browsers this attribute is displayed as a tooltip.
The lang attribute identifies the natural language of the element's contents, which
may be different from that of the rest of the document. For example, in an Englis

You might also like