HTML and CSS Reference
In-Depth Information
h ese browsing contexts are assigned as shown in the following snippet:
< a href = ”somePage.html” target = ”_blank” >
h e underscore in naming all the browsing contexts is required. So, something like
target =”blank” would not work — it has to be target=”_blank” .
In older versions of HTML, the frame and frameset elements were widely used and both
could be named as target values. Likewise, the _parent and _top browsing contexts would
be used to open a page in a dif erent frame. In HTML5, the major use of the target attribute
is to select the _blank browsing context over _self (default).
New browsing contexts in computer browsers
When you use the target attribute in the a element to create a _blank browsing context in
your computer, the current page remains on the screen and the requested page appears in a
new browser window or tab. h e following program ( Link2Target.html in this chapter's
folder at www.wiley.com/go/smashinghtml5 ) is a simple illustration of how this works.
<! DOCTYPE HTML >
< html >
< head >
< style type = ”text/css” >
h1 {
font - family : ”Arial Black” , Gadget , sans - serif ;
color : #060;
}
a {
color : #900;
}
h3 {
font - family : Verdana , Geneva , sans - serif ;
}
</ style >
< meta http - equiv = ”Content-Type” content = ”text/html; charset=UTF-8” >
< title > Open New Page </ title >
</ head >
< body >
< header >
< h1 > Original Page </ h1 >
</ header >
< nav >
< h3 >< a href = ”http://www.w3.org” target = ”_blank” > World Wide Web </ a ></ h3 >
</ nav >
</ body >
</ html >
141
 
Search WWH ::




Custom Search