HTML and CSS Reference
In-Depth Information
commonly used this way when linking to an external site, so the user still has the option of staying
on the current site:
<a href=” http://www.wikipedia.org/” t arget=”_blank”>Wikipedia</a>
The target attribute has four accepted values, although only two are useful in HTML5:
_blank:
Opens the linked content in a new window or tab, as determined by the browser
preferences.
_self:
Opens the linked content in the same window/tab as the current document.
Opens the linked content in the surrounding frameset, if present. Frames are obso-
lete in HTML5.
_parent:
Opens the linked content in the topmost frame, if present. Again, frames are obsolete in
HTML5.
_top:
Try iT
In this Try It you learn how to link to a page from another page.
Lesson requirements
You will need a text editor, a web browser and Thoreau.html.
You can download the code and resources for this exercise from the topic's web
page at www.wrox.com .
step-by-step
1.
Open your text editor.
2.
From the Lesson_08 folder, open thoreau.html .
3.
Place your cursor between the <p> tag and the text Henry David Thoreau .
4.
Enter the following code:
<a href=” http://en.wikipedia.org/wiki/Thoreau”target=”_blank”>
5.
Place your cursor after the text Henry David Thoreau .
6.
Enter the following code:
</a>
77 7
Save your text document.
8.
In your browser, open thoreau.html to view the link, as shown in Figure 8-2.
Search WWH ::




Custom Search