News for hackers. Stuff that matters.
Re:A Short Guide to Minimal Web Development (2018) by redmagic on Thursday August 27, 2020 @12:13PM (#24295142)
This webpage which is a guide to hand coding things appears to not have a closing </head>, </body>, or </html> tag.
Re:A Short Guide to Minimal Web Development (2018) by detaro on Thursday August 27, 2020 @12:17PM (#24295188)
Re:A Short Guide to Minimal Web Development (2018) by cringepirate on Thursday August 27, 2020 @01:31PM (#24296158)
That maybe but it differs from what is shown in the inspector (which shows the <head> and <body> tags). This could be confusing as the source html doesn't match how the browser interprets it.
Re:A Short Guide to Minimal Web Development (2018) by giantrobot on Thursday August 27, 2020 @03:07PM (#24297378)
Web inspectors are showing a representation of the DOM, they are not showing the raw source. Netscape and IE used to have "Show Source" functions that literally showed just the page source.

Inspectors will do things like display colors as their RGB triples i.e. rgb(x, y, z) in computed styles when a color has been defined in the HTML like in a body tag or table cell's bgcolor attribute.

Re:A Short Guide to Minimal Web Development (2018) by recursive on Thursday August 27, 2020 @04:36PM (#24298348)
All browsers still have show source. It's just not usually that useful anymore.
Re:A Short Guide to Minimal Web Development (2018) by cringepirate on Thursday August 27, 2020 @05:24PM (#24298856)
Yes I am aware. It can be confusing if you are new. I had someone ask me why it was different the other day.
Re:A Short Guide to Minimal Web Development (2018) by jrumbut on Thursday August 27, 2020 @06:23PM (#24299373)
I usually look at the network log for that information now.
Re:A Short Guide to Minimal Web Development (2018) by saagarjha on Thursday August 27, 2020 @01:54PM (#24296462)
Just because it is valid does not mean you should do it.
Re:A Short Guide to Minimal Web Development (2018) by recursive on Thursday August 27, 2020 @04:36PM (#24298350)
That's true. The reasons to do it are in the article.
Re:A Short Guide to Minimal Web Development (2018) by redmagic on Thursday August 27, 2020 @03:28PM (#24297636)
TIL!
Re:A Short Guide to Minimal Web Development (2018) by spenczar5 on Thursday August 27, 2020 @04:38PM (#24298367)
Others have pointed out that this validates with automated tools. Here's the parts of the spec:

- "An html element's end tag can be omitted if the html element is not immediately followed by a comment." https://html.spec.whatwg.org/multipage/semantics.html#the-ht...

- "A head element's end tag can be omitted if the head element is not immediately followed by ASCII whitespace or a comment." https://html.spec.whatwg.org/multipage/semantics.html#the-he...

- "A body element's end tag can be omitted if the body element is not immediately followed by a comment." https://html.spec.whatwg.org/multipage/sections.html#the-bod...

Re:A Short Guide to Minimal Web Development (2018) by jimsmart on Thursday August 27, 2020 @11:23PM (#24301073)
Personally, I prefer to close all of my elements, it avoids having to worry about accidentally triggering one of these hard-to-spot edge-cases.
Re:A Short Guide to Minimal Web Development (2018) by mfontani on Thursday August 27, 2020 @12:19PM (#24295201)
And yet, it validates - https://validator.w3.org/nu/?doc=https%3A%2F%2Fmeiert.com%2F...

Neither of the three tags you've mentioned are required anymore in HTML5.

Re:A Short Guide to Minimal Web Development (2018) by currysausage on Thursday August 27, 2020 @01:19PM (#24295999)
They weren’t required before HTML 5 either.
Re:A Short Guide to Minimal Web Development (2018) by recursive on Thursday August 27, 2020 @12:23PM (#24295245)
Your tone suggests that you think this is inconsistent.

However, I think it's evidence the author read the specifications as recommended.

Re:A Short Guide to Minimal Web Development (2018) by brainlessdev on Thursday August 27, 2020 @12:19PM (#24295203)
The author mentions something about omitting HTML tags and links to another article of his own, which could explain this (I haven't read it yet):

https://meiert.com/en/blog/optional-html/

Re:A Short Guide to Minimal Web Development (2018) by enriquto on Thursday August 27, 2020 @12:23PM (#24295239)
You do not even need the opening tags for a correct HTML5
Re:A Short Guide to Minimal Web Development (2018) by rimliu on Friday August 28, 2020 @08:12AM (#24303916)
It was the case in previous versions of HTML too. Here is my minimal document from 2005: http://rimantas.com/bits/minimal_html.html
Re:A Short Guide to Minimal Web Development (2018) by redmagic on Thursday August 27, 2020 @12:14PM (#24295155)
That being said, I very much like the spirit of the document. Many many good points.