| Tag | Description | | <a> | Defines an anchor |
More Examples
Open a link in a new browser window This example demonstrates how to link to another page by opening a new window, so that the visitor does not have to leave your Web site. <html> <body> <a href="lastpage.htm" target="_blank">Last Page</a> <p> If you set the target attribute of a link to "_blank", the link will open in a new window. </p> </body> </html>
Link to a location on the same page This example demonstrates how to use a link to jump to another part of a document. <html> <body> <p> <a href="#C4">See also Chapter 4.</a> </p> <h2>Chapter 1</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 2</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 3</h2> <p>This chapter explains ba bla bla</p> <h2><a name="C4">Chapter 4</a></h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 5</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 6</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 7</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 8</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 9</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 10</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 11</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 12</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 13</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 14</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 15</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 16</h2> <p>This chapter explains ba bla bla</p> <h2>Chapter 17</h2> <p>This chapter explains ba bla bla</p> </body> </html>
Break out of a frame This example demonstrates how to break out of a frame, if your site is locked in a frame. <html> <body> <p>Locked in a frame?</p> <a href="http://www.w3schools.com/" target="_top">Click here!</a> </body> </html> Create a mailto link his example demonstrates how to link to a mail message (will only work if you have mail installed). <html> <body> <p> This is a mail link: <a href="mailto:
Ova adresa je zaštićena od robota. Potreban vam je Java-skripta da bi ste je videli.
?subject=Hello%20again"> Send Mail</a> </p> <p> <b>Note:</b> Spaces between words should be replaced by %20 to <b>ensure</b> that the browser will display your text properly. </p> </body> </html> Create a mailto link 2 This example demonstrates a more complicated mailto link.
<html> <body> <p> This is another mailto link: <a href="mailto:
Ova adresa je zaštićena od robota. Potreban vam je Java-skripta da bi ste je videli.
?cc=cc
Ova adresa je zaštićena od robota. Potreban vam je Java-skripta da bi ste je videli.
&bcc=bcc
Ova adresa je zaštićena od robota. Potreban vam je Java-skripta da bi ste je videli.
&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!">Send mail!</a> </p> <p> <b>Note:</b> Spaces between words should be replaced by %20 to <b>ensure</b> that the browser will display your text properly. </p> </body> </html>
|