+ 1
Help. i dont quite get it. Explain me with examples.
inline and block elements. and what is the difference between them
1 Respuesta
+ 1
A block element takes up the full width of its parent. A div is by default a block element. If you had some parent node with a width of 200 px and you out a block element inside that parent node the child element would fill that entire available width of its parent. An inline element takes up only as much width as it needs to to hold its own content. If you had some inline element with 10 px of content inside it and you put it in the previously mentioned parent node, the inline element would still only take up 10 px of the available 200 px.
Block elements can also be styled with passing and margin which inline elements can not. These are just the basic differences.