Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: DariusBane
HTML eats excess white-space. If you type two or more spaces in a row between words HTML will reduce all of the spaces and tabs to a single space or tab. Carriage Returns (the Enter key) won't do you any good either. Without special care it is easy to end up with a wall of unreadable text. It's quite cruel. If you want white-space beyond a single space you need to insert it explicitly by typing <br> or <p> for a CRLF and a paragraph, respectively.

Break <br> works like you expect Enter (or Carriage Return) to work. It gets you a single LFCR (Line Feed Carriage Return, just like an ancient typewriter). Two styles of break are in use, the preferred version (used in HTML 5) is <br /> which contains its own closing tag. Paragraph <p> makes what follows into a paragraph set off by linefeeds. Neither <p> or <br> requires closing tag. The browser software will assume a paragraph is closed when it encounters the next <p>. Closing a paragraph actually makes good sense, closing a break seems like a waste of perfectly good characters.modulo the HTML gods referenced above.

Blockquotes are another useful trick. This entire paragraph has been enclosed in blockquotes. Anything you put between <blockquote> the example text <blockquote> gets indented and set off by linefeeds before and after. This example, rendered, will look like
the example text
the text above. Blockquotes can be nested (placed one inside another) and are a great way to distinguish the source of a quote from your own text.

Preformatted, or the <pre> tag provides a way to grab a bunch of text that is already formatted with tabs and spaces and not have HTML eat all that lovely white-space. As usual a closing tag is required with this </pre>. You can use this trick on a webpage but you need to realize that if the text you are copying wraps because it runs into the edge of the page and not because there is a CRLF present it will behave the same way in the preformatted chunk.

9 posted on 03/14/2014 6:21:53 AM PDT by Mycroft Holmes (<= Mash name for HTML Xampp PHP C JavaScript primer. Programming for everyone.)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: Mycroft Holmes

Thank you. I think Freepers have ADHD or something.

The article is short, easy to read. A link is supplied.

But all I see is weeping, sadness, gnashing of teeth by either the very old, the very young, or ADHD challenged old people.

So keep bitching about formatting and ignore the article.


17 posted on 03/14/2014 6:56:20 AM PDT by DariusBane (Liberty and Risk. Flip sides of the same coin. So how much risk will YOU accept? Vive Deco et Vives)
[ Post Reply | Private Reply | To 9 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson