View Single Post
Old 11-25-2014, 08:26 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,561
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by rosshalde View Post
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.

Last edited by Jellby; 11-25-2014 at 08:28 AM.
Jellby is offline   Reply With Quote