Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

Inline Frames 563

20


in the HTML source for parent.html, the three
hyperlinks could have been written as follows:

<!DOCTYPE html>




Parent Window - Red



Parent Window - Red


Open

the Yellow Page in a new window.


Open the Blue Page in a new
window.


Replace

the yellow page with the Green Page.




In this case, yellow.html and green.html load into the default window assigned by the


tag (yellow_page); blue.html overrides the default by defining its own target
window of blue_page.

You also can override the window assigned with the tag by using one of two spe-
cial window names. If you use target="blank" in a hyperlink, it opens a new browser
window that doesn’t have a name associated with it. Alternatively, if you use target="

self", the current window is used rather than the one defined by the tag.


If you don’t provide a target using the <base> tag and you don’t
indicate a target in a link’s <a> tag, the link will load the new
document in the same window as the link.

NOTE

Inline Frames


The main advantage of inline frames is that you can position them anywhere on a web
page, just as you can other elements like images or movies. You can incorporate content
from another page or even another site into a page in a seamless way through the use of
inline frames. In fact, inline frames, which are specified using the