Quote:
Originally Posted by rosshalde
With only the two <p> tags, how did I end up with four lines?
|
There are two basic display types in CSS/HTML: block and inline. Block elements force a linebreak before and after, and take all the available width. Inline elements do not introduce linebreaks and keep their natural width.
By default, elements like <p>, <div>, <blockquote>, <h1>... are block, and <i>, <strong>, <a>, <img>, <span>... are inline. But the "display" property can change that.
Actually, I could have used <div> instead of <span>, and removed the "display: block", but there is a rule that <p> cannot contain default-block elements, so I'd have to put the <div> outside <p>, and it starts to be messy.