Download Article
Learn how to code hyperlinks in HTML in a flash
Download Article

Are you trying to code a link into your HTML document? Links in HTML are called hyperlinks, because they directly jump you to a new document (or page). While some aspects of HTML take a little bit of time to grasp, coding hyperlinks is pretty easy. Keep reading to learn more.

Quick Steps

  1. Create a new HTML document.
  2. Add the hyperlink tag (<a href=" "></a>) to your document.
  3. Insert a URL in between the quotation marks.
  4. Insert the link text between the two tags.
  5. Save your document as an HTML file.
  6. Preview your site in your web browser.
  1. How.com.vn English: Step 1 Open a new document in a simple text editor.
    You can use Notepad or Notepad++ on Windows, or TextEdit on a Mac. You can also use any HTML editor that you prefer.
  2. How.com.vn English: Step 2 Create your HTML document.
    All HTML documents should be formatted with the same tags to create the document, head, and body. Below is the basic structure of an HTML document and is required for all web pages.
    • <html>
    • <head>
    • </head>
    • <body>
    • </body>
    • </html>
    Advertisement
  3. How.com.vn English: Step 3 Add the link to your document.
    The link should go somewhere in the head or body of your document. Begin your link by typing both the starting and end tags. Type out <a href=" "> followed by </a>.
    • This is also called an anchor tag, which is what the "a" represents.
  4. How.com.vn English: Step 4 Insert the link into the HTML.
    Copy the URL that you want to link to, and add it between the quotation marks in your code.
  5. How.com.vn English: Step 5 Insert the link text into the HTML.
    This text is what users will click on to follow the link. Insert this text between the two tags (tags are code enclosed in brackets).
    • Your link should look like <a href="[URL]">[link text here]</a>.
  6. How.com.vn English: Step 6 Save your HTML file.
    To preview in most cases, you'll have to save the file and open the file later. Make sure to save your file with an .HTML file extension.
  7. How.com.vn English: Step 7 Preview your site.
    Simply open the HTML file in a web browser to see what your site looks like. You can also try clicking the link to make sure it works and directs you to the page you want it to go to.
  8. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How would I link multiple webpages?
    How.com.vn English: Community Answer
    Community Answer
    Create the different links following the process above. Recognize the names of each file you create, and type them into the appropriate document, ensuring you don't link the same page to the page where it's been called into action (a file called page1.html can't be linked to page1.html, but page1.html can be linked to page2.html) and still be a worthy link.
  • Question
    How do I create a hyperlink on a given text using a notepad to go to the top of the page?
    How.com.vn English: Community Answer
    Community Answer
    Put the hyperlink on a text or image and then in the command put this code: < a href="The name of the current page " >. When the person clicks on it, the page reloads and opens the current page again, and the page is opened at the top.
  • Question
    How do I specify that a link will be opened in a new tab or window?
    How.com.vn English: Community Answer
    Community Answer
    You can right click the link.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      • You can add formatting to make the hyperlink look better on your site using CSS.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      Tested by:
      How.com.vn Technology Team
      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 22 people, some anonymous, worked to edit and improve it over time. This article has been viewed 351,048 times.
      How helpful is this?
      Co-authors: 22
      Updated: May 11, 2024
      Views: 351,048
      Categories: HTML
      Thanks to all authors for creating a page that has been read 351,048 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement