3 ms·
Here is an example of the kind of pretty minimal but valid HTML5 that I usually write when I write html by hand: <!doctype html> <html lang=en> <me
by codetrotter 3y ago
Here is an example of the kind of pretty minimal but valid HTML5 that I usually write when I write html by hand:
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>Hello</title>
<style>
/* css here */
</style>
<header>
<h1>Cool beanz</h1>
</header>
<nav>
<ul>
<li>Home
<li><a href=/foo.htm>Foo</a>
<li><a href=bar.htm>Bar</a>
</ul>
</nav>
<article>
<h2>The Life and Dreams of Irish Setters</h2>
<p>Widely appreciated for their qualities, the Irish Setter is a breed of dog to behold.
<p>Lorem ipsum and so on and so forth.
</article>
<footer>
<p>Copyright © 2024, Bob Schmob
</footer>
Check it :)
> Document checking completed. No errors or warnings to show.
https://validator.w3.org/nu/#textarea https://validator.w3.org/nu/#textarea
- mikae1 3y agoDon't forget Server Side Includes :) <!--#include file="/includes/header1.html" --> The Page Title <!--#include file="/includes/header2.html" --> The Article Title <!--#include file="/includes/header3.html" --> <p>The article content</p> <!--#include file="/includes/footer.html" -->
- robador 3y agoI've got to ask, the H1, why is the site name the main heading and not the title of the article?
- codetrotter 3y agoMainly because it is recommended [1] to have only one h1 on a page. And my pages sometimes contain multiple articles. It feels natural to me to have h1 be the site name. And have h2 be the content title. And it happens to work well when multiple unrelated articles or other kinds of content are on the page because then I use h2 for each of those. [1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements https://developer.mozilla.org/en-US/docs/Web/HTML/Element/He...