How Do I Insert a Link Using HTML?


Hyperlinks, or links, are a way to access another web page, image, movie, ftp file or other resource from the current page. An anchor tag is used to specify the URL (address) of the destination. The link text is usually displayed in a different format from the other words on the page, for example, blue and underlined. This lets visitors know that they can click on those words to be taken to another page.

Creating the Link

  • Use a text editor such as Windows Notepad to create an HTML document. Begin with the "<html>" tag and end with the "</html>" tag. Most HTML documents contain a "<head>" section which holds the metadata for the file. The "<body>" section defines what the visitor sees. Place your links here.

    The format for a link is: <a href="link">">link text</a>

    A link begins with the "<a href=">" tag where "" is the URL for the page to which you are linking. Next to this tag is the text that the visitor will click to access the linked page ("link text" in the example above). Finally, the link is closed with the "</a>" tag.

    Define where the link will open using the target attribute. The code "<a href="" target="_blank">link text</a>" opens the page in a new browser window.

    The target can be defined as "_blank", "_parent", "_self" or "_top". The link will open in a new window if you set the target to "_blank". The target will open in the same window if you set it to "_self". The "_parent" and "_top" definitions are used in web pages with frames. Setting the target to "_parent" will open the link in the current frame. Setting the target to "_top" will open the link in the top frame.

Related Searches


Promoted By Zergnet


You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

Is DIY in your DNA? Become part of our maker community.
Submit Your Work!