Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On block and inline nesting #31

Open
SelenIT opened this issue Jul 11, 2016 · 0 comments
Open

On block and inline nesting #31

SelenIT opened this issue Jul 11, 2016 · 0 comments

Comments

@SelenIT
Copy link

SelenIT commented Jul 11, 2016

The HTML block and inline elements section lists paragraphs (<p>) as block elements. The HTML hierarchy section states that

Block elements can contain either block or inline elements.

This seems to imply that paragrahps can contain block elements. Unfortunately, this is wrong: the content model for P element allows only phrasing content (HTML5 analog of HTML4's "inline elements"), and, since the end tag for P is optional (again, in contradiction to Block and inline elements section saying that all block elements always have closing tags) it gets implicitly closed just before any 'block' element opening tag, resulting in this new block element being its sibling, not child. It seems to be quite a common confusion for beginners (example).

Moreover, the tutorial claims that it is on HTML5, but HTML5 doesn't have terms 'block and inline elements' at all. It has 'flow content' and 'phrasing content' instead. Aside from being unable to explain why some block elements can contain other blocks and some block elements can't, the oversimplified 'block vs. inline' classification leads many beginners to false conclusion that an element can be converted from one kind to another just by changing its CSS display property (because its values sound the same).

Wouldn't it be better to use HTML5 terms in the HTML5 tutorial instead of HTML4 terms, and introduce the true "Content model" concept instead of oversimplified heurisitic rules with too many exceptions? It might be harder to get from start, but it will lead to much deeper understanding of the topic and much less confusion in the practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant