Skip to content
This day’s portion

Write HTML, the HTML Way (Not the XHTML Way)

| Comments | Permalink | Link

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 ps 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.

Original article by Jens Meiert. Published 29/03/22.

Add a comment

Required fields marked *. I won’t publish or share your email address.

Comments

None 🦉.

Mentions

Comments and replies to this post from other sites and services, such as micro.blog and Twitter.

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.