lundi 2 septembre 2019

What is the best way to link homepage on a website

I should note that the website I'm working on is meant to be pretty simple.

The way I have my website files organized is that under one folder containing the entire website, I have the .html file for the home page, which contains links to different pages inside it for photos, videos, etc. Each of these pages have their own folders.

Attached here is the code I have for one of these pages, meant for my photos. I learned from this thread (Link not going back to home page) that if you just have:

<a href="/">Home</a>

That the link will take you back to the index/root directory. (Is this different from the home page? Sorry, I'm a noob.) Although, when I originally had it has just the code above, the link takes me to this weird gray page that just shows all of the files of my website (is that root place or whatever it's called?). Although, I see that I'm able to from there just simply add the .html file for my home page in that link directory, so the code I have now seems to work.

Is this an okay way to have a link to go back to the home page? Thank you for your time.

<!DOCTYPE html>

<html>
    <style>
        div.img {
  display: inline; 
  max-width: 650px;
}
    </style>
    <body>
        <div> <!--Home Button-->
          <a href="/homepage.html" style="float: right; margin-right: 100px;">
            Home
          </a>
        </div>

        <div class="img">
           <img src="1.jpg" width="384px;" height="384px;">
           <img src="2.png" width="384px;" height="384px;">
           <img src="3.png" width="384px;" height="384px;">
           <img src="4.JPG" width="384px;" height="384px;">
           <img src="5.png" width="384px;" height="384px;">
        </div>
    </body>
</html>




Aucun commentaire:

Enregistrer un commentaire