Is it possible to wrap an
HTML provides two general elements, where Now, while both can be made by css However, css is only meant to be for making what an element looks like (presentation), but not actually be like (functionality), so it doesn't change an element's basic nature, though that gets very fuzzy in practice. A So, to mitigate against possible conflicts between their natural and css-induced behaviours, it is better to allow: This will also mitigate against tending to build page structures that will likely end up churning out error and warning messages. Basically, NEVER embed a natural block tag inside a natural inline tag, at any depth. Why there is a really a distinction is perhaps due to a simplistic idea of what HTML was going to be used for when it was first dreamed up. Certainly, framework makers got around a lot of these what-to-embed-where problems by just using myriads of It meant that they really only had to manage one tag per purpose and manage it as if it was an isolated environment. So what was meant to be an occasionally-used functional grouping tag became the web's Lego block. And none of them are going to risk breaking their frameworks by converting to HTML5 semantic tags in a hurry. tag around
div
is a natural block element, and span
is a natural inline element. All other elements are similarly assigned to be a natural block or inline.display
to be any of inline
, inline-block
or block
, they are still treated for enclosure purposes as their natural selves, hence the warning messages. Leopards and spots sort of thing.span
made block
becomes a bully that kicks everything else off the line, which is very un-inline
sort of behaviour.
div
or any natural block tag to only ever be block
or inline-block
.span
or any natural inline tag to only ever be inline
or inline-block
.div
s everywhere, and 'divitis' was born, and still alive and well in every framework. Just have to press F12
in a browser on almost any commercial web page and drill down through a dozen div
s. This very page has 15 unbroken levels of div
s.