Hacker News new | ask | show | jobs
by tannhaeuser 696 days ago
Are you serious? Embedding a language (CSS) into the string literals of another one (HTML) is of course much more complicated, and needlessly so.

Also, there's nothing XML-but-not-actually about HTML. Both HTML and XML are derived from SGML.

1 comments

The kid doesn't have to know that's it's CSS, and `style="background: url('animals.jpg')"` is more clear than just `background` because it explicitly states that this a networked resource that is being retrieved with the url() function. If you tried to set the `background` attribute to "blue" it wouldn't do anything, because you have to use the `bgcolor` attribute to color the background of the page. But the `background` property in CSS is a shorthand, so you can set it to a named X11 color, or a gradient, or an image file, and these all work.

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.

If I wasn't in bed on my phone I would disagree at length and in great detail with this.

Have you met any 7 year olds? Have you taught any beginners to do computer stuff?