Search code examples
htmlsublimetext3href

Why href and <a> tag not working using sublime 3?


I'm literally just starting to learn how to use HTML to learn how to build a website with the end goal of working out how to implement google analytics tags to get a better understanding of how things work in my 9-5 job.

HTML seems easy enough so far however when I'm using the "< a >" or href tags there doesn't seem to be anything appearing when opening the file in chrome.

I've been using sublime 3 as a text editor and it did pop up about purchasing the software or something after I'd written a few lines of html and tried to save it (sorry I didn't fully read the message before closing it). So I'm not sure if it's something to do with sublime 3 or my coding. It's probably something very simple and stupid I've done so any help would be appreciated.

HTML code below:

<html>

<head>
    <title>MY WEBPAGE!</title>
</head>

<body>

    <h1>Yo! Sup!</h1>   

    <h2>you can use header tags to create big heads in size 1-6</h2>

        <br> <img src="https://i.ytimg.com/vi/dGpZEuXoFWw/hqdefault.jpg">

    <br>  <br> You need to use br tag to create a new line

        <p>You can write in <strong>bold</strong>
            <br> You can also write in <em>italics</em>
            <br> Can you do <em><strong>both?</strong></em>
        </p>

    <p>You don't always have to use double br tags to start a new paragraph you can use the p tag, the good thing about p tag is it creates a space either side of the paragraph
    </p>

    What about underline?

    <br> <br> You can use the a tag to link to another site <a google.com></a>

    <br> <br> but you need to add a href in <a href="www.google.co.uk"></a>

    <br> <br> You can also you the img tag to identify an image source 

    <br> <br> you can create an unordered list using the ul and li tags which are used to create lists for drop downs and navigations

    <br> <br> 

    <ul>

        <li> first list item </li>

        <li> second list item </li>

        <li> third list item </li>

    </ul>

    <br> you can create an ordered list (which basically just gives the list numbers) by using the ol tag

    <ol>

        <li> first list item </li>

        <li> second list item </li>

        <li> third list item </li>

    </ol>

</body>

</html>

Thanks!


Solution

  • You need To put some Text inside that a tag! For instance

    <a href="http://google.com">Google</a>