Write HTML, the HTML Way (Not the XHTML Way)
| Comments
Write HTML, the HTML Way (Not the XHTML Way)
I really like Jens’ writing. He understands the – what should be very obvious as it’s the one programming language you cannot omit if you want to publish web pages – importance of HTML, and affords it the consideration normally reserved for javascript and, to a lesser extent, CSS.
Ah, XHTML – I’ll raise your 1.0 doctype
with a 1.1… When HTML 5 came along sanity, or rather, pragmatism was restored. Jens is right when he observes we still exhibit XHTML habits – I couldn’t use anything but lowercase tags and it would feel very weird not closing a p
. On the other hand, my hex codes are always uppercase and I was more than happy to drop />
Having said that, this pragmatism cuts both ways. Does it really matter if you retain verbose XHTML habits? I wonder how much is to be gained from paring back your markup, especially compared to, say, using javascript judiciously. Perhaps closing our p
s instils discipline, or at least the feeling of discipline and order.
But <input required readonly>
is indeed tersely beautiful. Because HTML isn’t XHTML we get the chance to explore these different syntaxes knowing we’re not going to break anything.
By Jens Meiert. Originally published 29/03/22.
Permalink: https://www.thisdaysportion.com/links/write-html-the-html-way-not-the-xhtml-way
Like of: https://css-tricks.com/write-html-the-html-way-not-the-xhtml-way/
Comments
Add a comment
No comments yet 🦉.
Webmentions
Comments and replies to this post from other sites and services, such as micro.blog and Mastodon.
Replies (2)
artkavanagh
@leonp No more " />" for me. I haven’t been consistent about it. Usually I try to avoid it but at times my resolve weakens. Thanks, interesting post.
leonp
@artkavanagh I used to find the order of space
/
>
unnatural, so was more than happy to use <br>