Live data from Hacker News

HEAD – A guide to elements

htmlhead.dev

1–10 of 129 posts

Re: HEAD – A guide to <head> elements

#3
This is specifically elements which are allowed in the `head` element of the document.

I recently read somewhere that for backwards compatibility reasons no new element types can be added within `head`. This causes a lot of overloading on the existing ones for elements like .

I don't have any supporting evidence though.

Re: HEAD – A guide to <head> elements

#4
post #2

This is absolutely mortifying, how much metadata do pages have to share with browsers to do that one weirdly specific thing!?

What weirdly specific thing?

You don't have to put anything in a head tag, you don't even need a head tag, but it's a good idea to have one and to at least add a charset meta tag. Everything is optional, though.

The entire point of it is for you to share metadata about your page with the browser.

Re: HEAD – A guide to <head> elements

#7
Does anybody remember that funny thread where some dev here was saying "who calls it HTML5 anymore" as if everyone else was out of touch with stagnating irrelevant skills that would immediately throw red flags during a phone screen?

It just gave me a chuckle thinking about it

Thanks for the guide!

Re: HEAD – A guide to <head> elements

#9
> Below are the essential elements for any web document (websites/apps)

> "...width=device-width, initial-scale=1..."

This is a surprising bit of opinionation to an otherwise decent presentation of head elements. Websites render quite nicely on modern phones without this line, but they generally render as if they are on a desktop browser. Using the above meta tag allows you easy access to modern approaches to mobile development.

Re: HEAD – A guide to <head> elements

#10

> Below are the essential elements for any web document (websites/apps) > "...width=device-width, initial-scale=1..." This is a surprising bit of opinionation to an otherwise decent presentation of head elements. Websites render quite nicely on modern phones without this line, but they generally render as if they are on a desktop browser. Using the above meta tag allows you easy access to modern approaches to mobile…

I'm not an expert. But in my experience, that line has been the solution to 100% of any viewport issue I've ever had on mobile, and has made webpages "just work" and render how I'd expect them to on mobile, as opposed to weird issues with font size and scrolling.

I've never had that line do something I didn't want. Is there a reason mobile browsers don't automatically just do whatever that line does? Seems like the opt-in behavior should be "yes, render me like I'm a desktop site on a tiny monitor" rather than opt-out.

Post reply on HN