Text Tags and Line Control
You've already used some of the text control tags. This section contains a few more which you can use if necessary.
Firstly, though, let's recall that the paragraph tags, <P> and </P>, start and close a paragraph. For example:
<P>How are you?</P>
<P>I'm fine.</P>
Comes out as...
but, curiously
<P>How are you?</P>
I'm fine.
and
<P>How are you?</P>
<P><P>
<P>I'm fine.</P>
and
<P>How are you?</P>
<P><P>
I'm fine.
...all do exactly the same thing, so what's happening?
- try each of the above and check the results for yourself
How can we describe, then, what the paragraph tags do? In fact, these tags are probably the most common and - along with the <BR> tag, which we'll meet in a moment - the most misunderstood of all. You should think of it this way:
"The use of the <P> and </P> tags to enclose a paragraph, ensures that the paragraph will have a blank line above it and a blank line below it. To put it simply, the tags create a bit of space around your text."
In the case of the last two examples above, the <P></P> tags don't actually enclose a paragraph - they don't enclose anything - and so they are ignored.
The 'line break' tag <BR> works like this:
<P>How are you?
<BR>I'm fine.</P>
...and this appears as:
You can usefully think of it as:
"Anything following the <BR> tag is 'broken' from the line above and goes onto its own line."
If you want extra space between paragraphs then there are several ways to go. We recommend the following because it fits in with the 'rules' that we've developed so far:
<P>How are you?
<BR>
<BR> </P>
<P>I'm fine.</P>
- try this code and check that it produces something like this:
Now is the HTML code for a non-breaking space - these can be very useful and we'll come back to them later. For the moment, though, you need to accept that each <BR> will print an 'invisible space' on the next line down in the paragraph - in other words you get an extra blank line. The example above gives you two extra blank lines, plus the one that you get anyway between paragraphs, making a total of three.
We note that, unlike many other tags, there is no </BR> tag - it wouldn't really make sense to 'unbreak' a line...
|