Web Contents Editors and Text Formatting: to get a single-line drop, press Shift & Enter
Notice how this line of text is directly below the heading above it, with hardly any space between them? Neat, eh? Have you ever wanted to achieve a similar single-line drop effect using the eDIY Software contents editor (or just about any other web page editor for that matter)?
And have you found, to you horror, that when you hit the Enter key the cursor drops a couple of lines instead of just one? That's all very well if you're not really bothered (and yes, they do say that plenty of "white space" is a good thing on a web page).
But a big gap isn't always what you want, and in any case, you ought to be given the choice. After all, it's your web site! Well, there's good news for all you would be single-line droppers out there. Like most things, the answer's really simple once you know it.
All you have to do to get a nice cosy drop of a single line is hold down the Shift key and then press Enter. Maybe it seems a bit of an anticlimax, now that I've let the cat out of the bag. But hopefully some of you will find it a useful tip; I know I did.
Technical Description
So what's with this two-line drop thing when you hit Enter anyway? For anyone who's interested, it's all to do with how most contents editors assume you want to format your page. When you hit Enter, this creates a new paragraph tag in your HTML source code (a paragraph tag is a kind of HTML command and it looks like this: <P>).
In fact, what you're really doing when you hit Enter after you've written some text is telling the HTML to end one paragraph by inserting a close paragraph tag </P> and then open a new one.
But, I hear you ask, why does it drop a whole two lines just because you start a new paragraph? Good point. After all, when you're using your word processor and you hit Enter, you're doing exactly the same thing (closing one paragraph and opening a new one). But you don't end up with a gap between paragraphs big enough to float a battleship down, do you? (Not unless you set your paragraph formatting options to make a space after, or before, your paragraphs, anyway.)
Well, to cut a long story short, the two-line drop is just a default setting. Someone once decided (rightly, as it happens) that it's a good idea to have a decent space between paragraphs if you're reading text on a screen. It breaks the text up into digestible chunks and generally makes life easier for the reader. Whoever set the default obviously didn't credit anyone with the good sense to create more white space by hitting Enter more than once. A dark day for free will, that.
So what actually happens in your source code when you hit Shift & Enter to get a single-line drop? Technically, it called a "line break" and is implemented in HTML by the insertion of a tag that looks like this: <BR>.
These line break tags are kind of interesting because they're unlike the vast majority of HTML tags . Most HTML tags only work in pairs (like the paragraph tags I mentioned earlier) and the pairs of tags enclose the section of text, or whatever, to which they appy (the close tag is identical to the open tag except that it's label is preceded by a forward slash). This makes sense, when you consider that what most of the tags are for is to format the way specific chunks of a web page look. These chunks are defined by the placement of the tags enclosing them.
But a line break isn't really a definable chunk of a page. It's more like an event - something that just happens. What's more, it's something that happens within a defined chunk (specifically, within a paragraph). So the <BR> tag is a bit of an orphan: it never has a corresponding </BR> tag. Indeed, there is no such tag as </BR> in HTML. (Actually, just to complicate things further, the line break tag in the latest version of HTML looks like this: <BR/>, signalling, you might say, that it incorporates its own end tag. It remains an orphan, all the same.)
Your feedback about any aspect of the software or services that we provide you is welcome. You can reply to this e-mail, or use the 'Contact Us' link on our web site.
We look forward to serving you as our customer!
Kind Regards,
eDIY Software
Christchurch & Auckland, New Zealand
International Phone: +64 3 982 0361
Freephone 0800 GO EDIY (463349) within NZ
Web: http://www.ediy.co.nz
Email: support@ediy.co.nz