HTML Reference
C.6 Text-Level Semantics
<a>
Full name
Anchor
Description
Represents a hyperlink or the named target destination for a
hyperlink.
Display
Inline
Attributes
href
If the <a> element is used as a hyperlink, this is a required attribute. Its value specifies
the link target in the form of a URL. Apart from the usual HTTP protocol for transfer-
ring hypertext documents, other protocols can be used as well (e.g., HTTPS, FILE, or
FTP). One can even establish a link to an internal target location within a document
(marked by another <a> element with an id a ttribute). This can be done by means of
a URL fragment, which is a n ame prece ded by a hash m ark (#).
target
This attribute specifies whe re to display the linked co ntent. If you use the _blank
keyword as a value of this attribute, the conte nt will be displayed in a new tab or
window.
Examples
<!-- A link to a hypertext document. -->
<a href="http://www.someweirdstuff.org/memberlogin.html">Let’s go
somewhere</a>
<!-- Open the document in a new tab/window. -->
<a href="http://www.someweirdstuff.org/memberlogin.html"
target="_blank">Let’s go somewhere</a>
<!-- A link to a PDF document. -->
<a href="http://www.someweirdstuff.org/appform.pdf">Application
form</a>
<!-- Mark a specific location within a page
www.someweirdstuff.org/benefits.html. -->
<a id="somewhere">This is totally amazing</a>
<!-- Link to that specific location from within the same page. -->
C.6. Text-Level Semantics 321
<a href="#somewhere">Go there</a>
<!-- Link to that specific location from some other page. -->
<a href="http://www.someweirdstuff.org/benefits.html#somewhere">
Go there</a>
<!-- Link that opens an email client. -->
<a href="mailto:ceo@nobigdeal.com">[email protected]</a>
<!-- With the subject line already filled in. -->
<a href="mailto:ceo@nobigdeal.com?subject=News">
ceo@nobigdeal.com</a>
<b>
Full name Bold (historic name)
Description Represents a part of text of a dierent meaning th an the rest
of the content without conveying any additional impo rtance.
The examples are: keywords in an abstract of a document,
product names, the first sentence or paragraph of an article,
or some other content that is typically represented in bold.
It is advisable to use the class attribute on this element to
identify why the element is being used.
Display
Inline
Example
<!-- From "Master of All Masters", an English Fairy Tale
by J. Jacobs. -->
<p><b class="firstsentence">A girl once went to the fair to
hire herself out for a servant.</b> At last a funny-looking old
gentleman engaged her, and took her home to his house. When
she got there, he told her that he had something to teach her,
for that in his house he had his own names for things.</p>
<em>
Full name Emphasized
322 HTML Reference
HTML Reference
Description Represents stress emphasis of its contents. Although many
browsers display the contents of an <em> element in italics,
the element is not intended to represent a generic italics el-
ement. T he <i> element is m ore appropriate for that. Also,
the <em> element sho uld not be used to express importance.
The <strong > element is more appropriate for that purp ose.
Display Inline
Examples
<p><em>Pizza</em> is a healthy food.</p>
<p>Pizza <em>is</em> a healthy food.</p>
<p>Pizza is a <em>healthy</em> food.</p>
<p>Pizza is a healthy <em>food</em>.</p>
<p><em>Pizza is a healthy food!</em></p>
<i>
Full name
Italics (historic name)
Description
Defines a fr action of text in an alternate mood or otherwise
deviated from normal pr ose, such as a technical term, an id-
iomatic phrase from anothe r language, a thought, or some
other content that is typically represented in italics. I t is ad-
visable to u se the class attribute on this element to identify
why the element is being used.
Display Inline
Example
<p>The domestic cat (<i class="taxonomy">Felis catus</i>) is a
small, usually furry and cute, domesticated carnivorous mammal.
</p>
<q>
Full name
Quote
C.6. Text-Level Semantics 323
Description Represents some content quote d inline from ano ther source.
Display
Inline
Attributes
cite
Names the source URL of the quoted information.
Examples
<p>Tom said, <q>That is really theoretically impossible but turned
out to be possible in practice</q>.</p>
<p>In his speech at The University of California DNA stated that
<q cite="http://www.youtube.com/watch?v=_ZG8HBuDjgc">we don’t
have to save the world. The world is big enough to look after
itself. What we have to be concerned about is whether or not
the world we live in will be capable of sustaining us in it.</q></p>
<small>
Description Defines small print or other side notes. Typically, it is used
for disclaimers, legal restrictions, or copyrights, as well as
for attr ibution or meeting licensing r equiremen ts.
Display
Inline
Examples
<small>(C) Copyright 1454 Gutenberg Ltd.</small>
<small>All terms subject to change without notice.</small>
<span>
Description
Does not convey any meanin g but can be useful in combina-
tion with certain attributes. It is normally used in the same
way as the <div> element, only <div> is a block-level ele-
ment, while <span> is an inline e le ment.
324 HTML Reference
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.147