HTML and CSS Reference
In-Depth Information
Ifyouwantalink'stargettoappearwithinthemainframe,applythetargetattributeasfollows:
<aƒhref=”gloss.htm”ƒtarget=”main”>Displayƒtheƒglossary</a>
Inadditiontoframenames,youcanalsospecify
reserved target names
,
whichcause
alinkeddocumenttoappearwithinaspeciiclocationinthebrowser.FigureE-5liststhe
reservedtargetnamessupportedbyHTML.
Figure e-5
Reserved target names
Reserved Target Name
Function in a Frameset
_blank
Loads the target document into a new browser window
_self
Loads the target document into the frame containing the link
_parent
Loads the target document into the parent of the frame containing
the link
_top
Loads the document into the full display area, replacing the current
frame layout
Forexample,ifyouwantalinktargettoappearinanewbrowserwindow,youcould
enterthefollowingcode:
<aƒhref=”gloss.htm”ƒtarget=”_blank”>Displayƒtheƒglossary</a>
Allreservedtargetnamesbeginwiththeunderscorecharacter(_)todistinguishthem
fromothertargetnames.Notethatreservedtargetnamesarecase-sensitive,soyoumust
entertheminlowercase.
Using the
noframes
Element
TomakeyourWebsiteviewablewithbrowsersthatdonotsupportframes(knownas
frame-blind browsers
)aswellasbythosethatdo,youcanusethe
noframes
elementto
markasectionofyourHTMLileforcodethatbrowsersincapableofdisplayingframes
canuse.The
noframes
elementisnestedwithinthe
frameset
elementasfollows,andit
usesthesyntaxshown:
<html>
<head>
<title>
title
</title>
</head>
<frameset>
ƒƒƒframes
ƒƒƒ<noframes>
ƒƒƒƒƒƒ<body>
ƒƒƒƒƒƒƒƒƒpage content
ƒƒƒƒƒƒ</body>
ƒƒƒ</noframes>
</frameset>
</html>
where
page content
isthecontentthatyouwantthebrowsertodisplayinplaceofthe
frames.Adocumentcancontainonlyone
noframes
element.Whenabrowserthatsup-
portsframesprocessesthiscode,itignoreseverythingwithinthe
<noframes>
tagand
concentratessolelyonthecodetocreatetheframes.Whenabrowserthatdoesn'tsupport
framesprocessesthisHTMLcode,however,itdoesn'tknowwhattodowiththe
<frameset>
and
<noframes>
tags,soitignoresthem.Itdoesknowhowtorenderwhateverappears
withinthe
<body>
tags,though.Usingthissetup,bothtypesofbrowsersaresupported
withinasingleHTMLile.Notethatwhenyouusethe
<noframes>
tag,youmustenclose
thepagecontentwithina
body
element.