by skgough · 2y ago · 0 comments
<body style="background: url('animals.jpg')">
<div style="text-align: center">
Which isn't much more complicated, and makes it clearer what's going on. I wonder if there is a transpiler like Elm that could take a single file written in a simplified language and gave you an HTML5 compliant webpage? You could argue that all the XML-but-not-actually-XML crap in HTML (angle brackets, closing tags, escaping special characters with HTML entities...) is also an impediment to beginners.Hard disagree on both points.
Disclaimer: I'm not found of web techs...
Also, there's nothing XML-but-not-actually about HTML. Both HTML and XML are derived from SGML.
The `<center>` element spans the width of it's container, is only as tall as it's content, and only centers the content contained inside it horizontally, but this isn't immediately obvious just from looking at the element's name. Using `text-align: center` instead is a much more obvious way to describe what the `<center>` element is actually doing.
Yes, this is more complicated, but it is more obvious, which, I think, is more useful when someone is learning a complex topic.
Have you met any 7 year olds? Have you taught any beginners to do computer stuff?