Block elements vs inline elements in HTML: why the distinction?
Posted
by
EpsilonVector
on Programmers
See other posts from Programmers
or by EpsilonVector
Published on 2011-03-24T03:05:04Z
Indexed on
2011/11/25
18:03 UTC
Read the original article
Hit count: 388
The distinction between block and inline elements always seemed strange to me. The whole difference is that a block element takes up the entire width thus forcing a line break before and after the element, and an inline element only takes up as much as the content. Why not just have one type of element- an inline element where you can also apply custom height/width, and use that? You want line breaks? Insert a <br />
, or maybe add a special tag in the CSS for that behavior. The way it's now, I don't see it solving any problem, and instead it only forces a property that in my opinion should be decided by a designer.
So why the two types?
© Programmers or respective owner