HTML and CSS Reference
In-Depth Information
what kind of content will go into the cells. However, when tables are generated
by server-side scripts drawing content from a database, it is less certain what
content, if any, will go into a given row or cell. herefore, extra care is needed
to deal with null data values and edge conditions.
Links and Anchors
Links are the lifeblood of the Web, and Hypertext is the name of the Markup
Language. hat said, “link” is a strange word. It is both a noun and a verb,
and its use is loose. And how can a link be hyper? Two elements in HTML,
the anchor and area elements, when used with an href (hypertext reference)
attribute, create hyperlinks. A third element, the link element ( <link/> ), can
also create hyperlinks when used with certain attributes. It is a document head
element providing a means for web authors to link the current document to
other resources on the Web. he link element is discussed further in the sec-
tion “Page Head Information” in Chapter 5. 3
he anchor element, <a></a> , in HTML5 is allowed to contain any other
content and markup, including nested block elements. It should not, however,
contain any markup that responds to mouse clicks or inger taps. It is rare in
practice to code a link that spans multiple block elements such as paragraphs
and lists. Such constructions may be more diicult for search robots to under-
stand than if the separate paragraphs and list items were each linked to the
same URL. It is also more diicult to maintain a consistency of link styling if
links span multiple elements.
Because the introduction of the irst graphical web browsers in 1993, the
default formatting behavior for browsers is to underline the text content of an
anchor element and make it blue (linked images get a blue border). One of the
irst browser enhancements was to give both web authors and browser users
the ability to change the style and color of links. A distinctive look for links
is an important branding tool for website designers, and a consistent look for
linked text items is an important aid to navigation.
he area element, <area/> , is a content-free, self-closing element that does
not afect the rendering of a web page. It is used to specify that a subarea of
an image is hyperlinked to a Web resource. he area element must always
be the child of a map element, which can be referenced by an image element
elsewhere on the page. Like the anchor element, the area element becomes a
hyperlink when used with an href attribute whose value is a valid URL.
3. Any HTML element, actually, can create a hyperlink if that element has an event handler attribute
to detect an appropriate user action and can execute an instruction to set the document's location to a
new URL.
 
 
Search WWH ::




Custom Search