<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg" -->

---
title: My HTML Boilerplate | daily.dev
description: A detailed walkthrough of a personal, opinionated HTML boilerplate template covering the full document head and basic body structure. Each element is explained...
canonical: https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: My HTML Boilerplate | daily.dev
og:description: A detailed walkthrough of a personal, opinionated HTML boilerplate template covering the full document head and basic body structure. Each element is explained...
og:url: https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg
og:image: https://api.daily.dev/og/posts/HwMlvdvzG.png
og:image:alt: My HTML Boilerplate
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# My HTML Boilerplate

**[Lobsters](https://daily.dev/sources/lobsters)** · 11 min read · 12 upvotes · 2 comments

## Summary

A detailed walkthrough of a personal, opinionated HTML boilerplate template covering the full document head and basic body structure. Each element is explained line by line: the doctype, lang attribute, charset placement, viewport meta tag (and why initial-scale isn't needed), the experimental text-scale tag, title conventions, stylesheet and font preload ordering, Open Graph and social embed tags, favicon format choices, canonical URLs, color-scheme and theme-color for dark mode, RSS/JSON feed autodiscovery, opensearch integration, and web app manifest linking. Closes with pointers to further boilerplate additions like citation meta tags, Dublin Core, and JSON-LD for specialized page types, plus a reference to Manuel Matuzović's more expansive boilerplate article.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://vale.rocks/posts/html-boilerplate>

## Questions this post answers

### Do I need the crossorigin attribute when preloading a font that's hosted on the same origin?

Yes, the crossorigin attribute is still necessary even for same-origin font preloads. Fonts are fetched in 'anonymous' CORS mode by the font-loading mechanism regardless of origin, so omitting crossorigin on a preload link causes the browser to fetch the font twice, wasting bandwidth and defeating the preload's purpose.

_Developers tuning font-loading performance can find HTML head ordering guidance like this on daily.dev._

### Should I include initial-scale=1 in my viewport meta tag?

It isn't necessary to include initial-scale=1 in a viewport meta tag beyond width=device-width. It only matters for changing a page's presentation if an element horizontally overflows the viewport width, but that overflow should never be allowed to happen in the first place, so the value adds no real benefit on a well-built responsive site.

_Anyone auditing responsive meta tags can compare boilerplate choices like this on daily.dev._

### What image dimensions and format should I use for og:image social media embeds?

A 1200px by 630px image in WebP format is a widely supported choice for og:image social embeds. WebP is described as the best-supported modern image format for this purpose, and that pixel size renders well across most social media and chat platform embed previews.

_Developers configuring social share metadata can track practical defaults like this on daily.dev._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 9 comments across lobsters (as of 2026-09-11).

**TL;DR:** Discussion focuses on technical nitpicks around the boilerplate's claims, especially whether html/head/body tags are truly optional versus just implied, plus some debate on the viewport meta tag's necessity.

**Sentiment:** 30% positive · 55% mixed · 15% skeptical

**The case for**

- Some found the walkthrough genuinely helpful for ongoing HTML work.
- One commenter appreciated the well-defined parsing rules underlying implied tags rather than dismissing them as guesswork.

**The pushback**

- Multiple commenters corrected the claim that html/head/body tags are 'optional', arguing they are technically implied rather than optional and browsers don't guess but follow well-defined parsing rules.
- Omitting the body tag was flagged as risky since inline scripts might see document.body as null.
- The viewport meta tag advice was debated, with one commenter skeptical of its necessity and another clarifying it's needed for any mobile device testing.

**By community**

- lobsters (mixed): Commenters mostly offered technical corrections and clarifications on specific boilerplate details rather than judging the post overall, with a couple of genuinely appreciative notes.

**Hottest debate:** Whether html/head/body tags are truly 'optional' in HTML5 or merely implied via well-defined parsing rules.

**Highlights**

> The html and head tags (and body too) have been optional in every version of HTML not named XHTML.
> — [bentley on lobsters · 1 points, 1 comments](https://lobste.rs/s/6tcc4t/my_html_boilerplate#c_fpz79l)

> Omitting <body> is a bit risky in my opinion because inline script may see document.body == null.
> — [skobes on lobsters · 1 points](https://lobste.rs/s/6tcc4t/my_html_boilerplate#c_ebecwg)

**Source threads**

- [lobsters](https://lobste.rs/s/6tcc4t/my_html_boilerplate) · 27 points · 9 comments

## Community discussion

Top comments from developers on daily.dev.

**@developerkwame** · 0 upvotes

> This reminds me of HTML5 Boilerplate.

## Similar posts on daily.dev

- [My HTML boilerplate in 2026](https://daily.dev/posts/my-html-boilerplate-in-2026-sba9xvade) · Manuel Matuzović · 40 upvotes · 4 comments
- [Antiquated HTML Snippets and Artefacts](https://daily.dev/posts/antiquated-html-snippets-and-artefacts-oaojgodsy) · Lobsters · 2 upvotes · 0 comments
- [You, too, can make a boilerplate](https://daily.dev/posts/you-too-can-make-a-boilerplate-4sbvmezfu) · thoughbot · 23 upvotes · 0 comments
- [Headings: Semantics, Fluidity, and Styling — Oh My\!](https://daily.dev/posts/headings-semantics-fluidity-and-styling-oh-my--w2kfkv1uv) · CSS-Tricks · 13 upvotes · 1 comments
- [Nerdy Design Details](https://daily.dev/posts/nerdy-design-details-uhtk6vxkh) · Kitty says hi. · 22 upvotes · 4 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#html](https://daily.dev/tags/html), [#accessibility](https://daily.dev/tags/accessibility), [#seo](https://daily.dev/tags/seo)

[View this post on daily.dev](https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"My HTML Boilerplate","url":"https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg"},"datePublished":"2026-09-11T07:51:21.402Z","dateModified":"2026-10-15T02:22:27.230Z","description":"A detailed walkthrough of a personal, opinionated HTML boilerplate template covering the full document head and basic body structure. Each element is explained...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/497088073f06ecf085d15afc531ed7ff?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/497088073f06ecf085d15afc531ed7ff?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Lobsters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":12},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"webdev,html,accessibility,seo","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"My HTML Boilerplate"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg","comment":[{"@type":"Comment","text":"This reminds me of HTML5 Boilerplate.","datePublished":"2026-09-13T15:05:50.952Z","url":"https://daily.dev/posts/HwMlvdvzG#c-x0UQx8rvS","author":{"@type":"Person","name":"Kwame Oteng Appiah-Nti","url":"https://daily.dev/developerkwame","image":"https://media.daily.dev/image/upload/s--A2GyhQUO--/f_auto/v1785559558/avatars/avatar_nKDQITDxjirA6sjjW7A3P?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/my-html-boilerplate-hwmlvdvzg#faq","mainEntity":[{"@type":"Question","name":"Do I need the crossorigin attribute when preloading a font that's hosted on the same origin?","acceptedAnswer":{"@type":"Answer","text":"Yes, the crossorigin attribute is still necessary even for same-origin font preloads. Fonts are fetched in 'anonymous' CORS mode by the font-loading mechanism regardless of origin, so omitting crossorigin on a preload link causes the browser to fetch the font twice, wasting bandwidth and defeating the preload's purpose. Developers tuning font-loading performance can find HTML head ordering guidance like this on daily.dev."}},{"@type":"Question","name":"Should I include initial-scale=1 in my viewport meta tag?","acceptedAnswer":{"@type":"Answer","text":"It isn't necessary to include initial-scale=1 in a viewport meta tag beyond width=device-width. It only matters for changing a page's presentation if an element horizontally overflows the viewport width, but that overflow should never be allowed to happen in the first place, so the value adds no real benefit on a well-built responsive site. Anyone auditing responsive meta tags can compare boilerplate choices like this on daily.dev."}},{"@type":"Question","name":"What image dimensions and format should I use for og:image social media embeds?","acceptedAnswer":{"@type":"Answer","text":"A 1200px by 630px image in WebP format is a widely supported choice for og:image social embeds. WebP is described as the best-supported modern image format for this purpose, and that pixel size renders well across most social media and chat platform embed previews. Developers configuring social share metadata can track practical defaults like this on daily.dev."}}]}
```

