Links in frames

If you want to link to a document that opens in a new browser window, use the target = "_ blank" tag <A>.

To create a new window is usually required in cases where reference is made to another site. In other cases it is better to open documents in the current window, as the abundance of windows can capture the reader confused.

Since the reference to the current or the new window does not differ from each other, on some sites link next to put a special icon, indicating that the document is opened in a new window.

Example 1: Create a link to a new window

valid HTML
<DOCTYPE HTML PUBLIC! "- // W3C // DTD HTML 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Links </ title>
</ Head>
<Body>

<P> <a href="http://www.shram.kiev.ua"> Usual link to a website www.shram.kiev.ua </a> </ p>
<p> <a href="http://www.shram.kiev.ua" target="_blank"> Link opens a new window on the site www.shram.kiev.ua </a> </ p>

</ Body>
</ Html>

If your Web page needs to be done so that all links open in a new window, there is no need to add all the tags <A> parameter target = "_ blank". Code can be reduced, if at the beginning of the page add the <base target = "_ blank" >, as shown in Example 2.

Example 2. Using the tag <BASE>

valid HTML
<DOCTYPE HTML PUBLIC! "- // W3C // DTD HTML 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Links </ title>
<Base target = "_ blank" >
</ Head>
<Body>

<P> <a href="1.html"> Link will open in a new window </a> </ p>
<P> <a href="2.html" target="_self"> Link will open in the current window </a> </ p>

</ Body>
</ Html>

To do so, to open the URL in the current window, then you can, if you add a tag <A> parameter target = "_ self", as shown in this example.

© Policy Copyright www.htmlbook.ru