Suite101

We're on our way


© Oisin Prendiville

After reading my last article (if you haven't you should) you are able to write a very basic web page. Now when I say basic I mean BASIC, all you can do at this stage is put a title on your page and insert text in the body of the page. OK, then let's get on with the show! This article covers new lines and paragraphs, discusses html's rendering of white space, teaches you about attributes and covers some basic formatting.

New line
If you want to go on to the next line in a word processor you simply press [enter]. However, if you type the following into a html document:

<html>
<body>
Here is some writing.
Now it is on a new line.
</body>
</html>

Wrong!
This is what will appear on the web page:

Here is some writing. Now it is on a new line.

If you want to start more text on a new line you should write:

<html>
<body>
Here is some writing. <br>
Now it is on a new line.
</body>
</html>

Standalone
You will notice that the <br> tag does not have a corresponding </br> tag. That is because it is a standalone tag. It is the first standalone tag you have come across, but it will not be the last.

Paragraphs
On the Internet paragraphs are presented with a blank line in between them. I personally believe that paragraphs look better and are easier to read when the first line of the new paragraph is indented. I will show you how to do both.

Blank line
First of all, the Internet blank line way:

<html>
<body>
<p>Here is my first paragraph..........</p>
<p>Here is my next paragraph.............</p>
</body>
</html>

This can also be written as:

<html>
<body>
Here is my first paragraph.......<p>
Here is my second paragraph.......
</body>
</html>

Both of the above are presented the same in the browser but each uses a different approach. In the first example you are treating the <p> tag as a container tag, and enclosing each paragraph in a container. In the second example you are treating the <p> tag as a standalone tag that is inserted in the text when you want to start a new paragraph. The first example is the way that the tag is designed to be used but the second example works just the same. It's up to you which one you adopt.

Indenting
There is also the other way that I mentioned but before I show you this way I should demonstrate something else.

Go To Page: 1 2


Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo