SBS HTML Logo
CLOSE

HTML Links

HTML links are used to link to pages on your website or other pages on the web. Change your code to the code below.

<!DOCTYPE html>
<html>
    <head>
        <title>This is my page title.</title>
    </head>
    
    <body>
        <h1>My First Web Page</h1>
        
        <h2>What is this?</h2>
        <p>This is a page put together using HTML.</p>
        
        <h2>Where can I find all the information in the world?</h2>
        <p>Go to <a href="https://www.google.com">Google</a></p>
    </body>
</html>
Expand

Links are created using the <a> or anchor tag. The href attribute tells the link where to go. You can link either to files on your website or to files anywhere on the web. If you're linking to files outside of your website you will need a full path to the file including https://.

Linking to Sections of your Page

You can also link to sections of your web page. By giving an id attribute to one of your body elements, you can tell a link to scroll to it. For instance if I had <h1 id="top"></h1> at the top of my page and a <href="#top">Go to Top</a> at the bottom of my page, clicking that anchor would scroll to my heading element.

Share This Tutorial

Link To This Tutorial

Tutorial URL
https://stepbystephtml.com/tutorial/15/html-beginner-tutorial

HTML Link

Help Us to Help You

This website and it's tutorials are only made possible with your support. Support money goes towards keeping our servers online.

Link to Us

Spread the word! Let people know about our tutorials by placing links on blogs, websites, forums and other places.

HTML Link

Copyright 2017 Step By Step HTML. All Rights reserved.