My doubt is that each navbar button should direct me to another document? That is, should I copy the code of that headerin each of the .html files? Or is it done in some other way?
Of course you can avoid copying and pasting the code of your < NAV > , in fact it is a bad practice, what you should do is have a structure similar to this one that I will show you in JAVA language :
WEB STRUCTURE IN JAVA - SERVER - TOMCAT
Well in java it is very common to use .jsp, jsf, etc. files. Which are html , as you can see.
In the header.jsp I indicate all the styles that will be needed for the page.
Finally I conclude that you can apply this same logic to recycle html structures in any language like PHP, C# have their own methods to include html in other html. This way you will have your web page more organized and without much code.
I hope I have guided you in what you needed, greetings.
If you are only using HTML file, the answer is YES, in each file you must copy that HTML code.
Another story would be if you use any server-side language like PHP, ASP.NET, JSP, NodeJS, which allow you to create HTML pages dynamically, which allows you to reuse portions of HTML code like the one you indicate.
Hello, although your question has already been answered, I would like to add one more contribution:
in your Navbar did you have to have a li tag to add in the menu? ok simply inside that tag you add a link like this:
<li><a href="midocumento.html">acerca</a></li>
and ready where it says
href
there you simply add the path of your document correctly with the .html extension and that's it, you just need to add your navbar code in each html document you have.
Of course you can avoid copying and pasting the code of your < NAV > , in fact it is a bad practice, what you should do is have a structure similar to this one that I will show you in JAVA language :
WEB STRUCTURE IN JAVA - SERVER - TOMCAT
Well in java it is very common to use .jsp, jsf, etc. files. Which are html , as you can see.
In the header.jsp I indicate all the styles that will be needed for the page.
In the nav.jsp the navigation menu will go.
In the footer.jsp is the footer text and the scripts that will load the page.
Finally in any other jsp(html) pages that need to use the ,HEADER, NAV and FOOTER, did the following:
NOTE: Notice how I include the jsp that I have defined in other jsp(html) to make use of in the index.jsp.
Finally I conclude that you can apply this same logic to recycle html structures in any language like PHP, C# have their own methods to include html in other html. This way you will have your web page more organized and without much code.
I hope I have guided you in what you needed, greetings.
If you are only using HTML file, the answer is YES, in each file you must copy that HTML code.
Another story would be if you use any server-side language like PHP, ASP.NET, JSP, NodeJS, which allow you to create HTML pages dynamically, which allows you to reuse portions of HTML code like the one you indicate.
Hello, although your question has already been answered, I would like to add one more contribution:
in your Navbar did you have to have a li tag to add in the menu? ok simply inside that tag you add a link like this:
and ready where it says
there you simply add the path of your document correctly with the .html extension and that's it, you just need to add your navbar code in each html document you have.