3
I am creating a website and have the following structure:
<body>
<div class="container">
<?php require_once('includes/header.php'); ?>
<?php require_once('includes/main.php'); ?>
</div>
<?php require_once('includes/footer.php'); ?>
It’s working normal, but I don’t know if I’m doing it right, the footer is outside the container div, if I put it inside it it doesn’t stay at the bottom of the site. would like to know from those who know well the development of sites which is the best structure for the development of sites.
It depends on the requirements of its application, that is, it varies greatly according to its objective. For example, considering that the class
container
comes from Bootstrap CSS, it has a width defined according to the size of the screen. If you need a footer with 100% of the width of the screen, you need to have it outside thediv
. Sometimes it is interesting to leave it in. It depends a lot.– Woss
It’s pure, there’s no framework.
– Israel Sousa
Look, it’s probably outside the scope, the way it is, maybe if it changed to "there’s a blah blah pattern," but I don’t know how to let the community evaluate... Check out this link https://www.w3.org/wiki/HTML_structural_elements ... The element structure is linked to the DOM tree that browsers mount, now the positioning is relative to css, you can have 2 types of structure, with the same visual adjusted by css... now if I’m not mistaken you are expected a certain example structure, semantically
header
should in my opinion come beforecontainer
, themain
...– MagicHat
Even so. There is no way correct to ask. Your question is too broad.
– Woss
should be the
container
and then thefooter
, all within thebody
...– MagicHat
@Andersoncarloswoss I think you expressed yourself badly, I believe there can be several correct ways...
– MagicHat
Anderson, the problem is I don’t know what’s the best way to do it, according to the closest way to a pattern.;..
– Israel Sousa
@Magichat, yes, it would have been better to highlight the "one" instead of the "correct", but what I meant is exactly this: there is not only one way to do it or one that is absolutely correct.
– Woss
There may be more than one footer per section and it may have different order @Magichat ... this question is totally opinionated.
– Guilherme Nascimento
@Guilhermenascimento yes, at no time I said that I was not (I still talked about it in my first comment), but anyway there is a standard, convention I don’t know the name, and the most important validators... And yet in my reply I addressed his point of view through uniqueness...(I always wanted to use that word, heuheu),,,
– MagicHat