Is there a standard for structuring a website in HTML?

Posted on

Question :

I’m creating a website and I have the following structure:

<div class="container">

    <?php require_once('includes/header.php'); ?>
    <?php require_once('includes/main.php'); ?>

<?php require_once('includes/footer.php'); ?>

It’s working normal, but I do not know if I’m doing it right, the footer is outside the container div, if I put it inside it it’s not in the bottom of the site. I would like to know of those who know the development of websites the best structure for the development of websites.


Answer :

The recommended structure for an HTML5 page in your case might look like this:

<!DOCTYPE html>
<title>título da página</title>
    <nav>menu principal</nav>
       <?php require_once('includes/header.php'); ?>
      <?php require_once('includes/main.php'); ?>
       <?php require_once('includes/footer.php'); ?>

The “NAV” tag can stay within “HEADER” if you prefer. So your code will be more semantic and using html5 tags facilitates indexing by search engines. Regarding the footer, there are several ways to keep it fixed at the bottom of the window, here are 5 ways to do this.


The default structure for a html document is as follows:

<!DOCTYPE><!--Document Type Definition-->
    <head>Meta dados</head>


Now within body you can set up various type of layout … Where I believe (I have no sources) there is a sequence, being header , content , footer , but this can vary a lot depending on the DTD and other details that make each singular purpose …

Anyway you can use one of many validators, for example:

And here you can see information about the global standard.


Leave a Reply

Your email address will not be published. Required fields are marked *