The <P> Command
The main difference between the HTML page and the traditional editor is that HTML does not recognize the Enter key. You need to force the end of the paragraph and the line break by using special commands. The command responsible for the paragraph break is the <P> Command. It's syntax is:
<P>
Open the Examp02.htm file in the browser. It's contents are shown below:
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1>example of paragraphs are line breaks</H1>
The HTML language ignores pressing the enter key at the end of the line. <P>
While typing this text, I pressed enter before the word "line" of the previous sentence. <P>
When the browser displays this page, the first two sentences will be in a single paragraph. To create a paragraph you should insert the p command enclosed in <>. <P>
<P>
<P>
<P>
<P>
To insert blank lines you should not use one of these commands for each line you wish to leave blank. See that although 4 of these commands were specified before this paragraph, only one line was left blank. If you wish to visually separate a section of the page, you can use the "HR" command enclosed in <>. It inserts a horizontal line in its place.
<P>
<HR>
<P>See. The previous line contains the HR command. <P>
</BODY>
</HTML>
Besides the <P> command, which inserts a blank line and advances the text to the next line, you can create a text block separation by using the <HR> command, which inserts a line in the place specified.
The browser adjust the text according to the width of the window, as seen in the following figure.
Note that the <P> command is obeyed and executed, even though the window has been resized.
The <BR> Command
The <P> command inserts a blank line immediately after it is specified. In many situations, you need to break the line and continue the text on the next line. In this case, the command to be used is the <BR> command, the syntax of which is:
<BR>
Load the examp03.htm file, the source code of which is shown below:
<HTML>
<HEAD>
</HEAD>
<BODY>
<H1>more paragraphs and line breaks</H1>
As we said before, it's no use pressing the ENTER key at the end of a line.<P>
The Browser doesn't recognise it.<P>
<HR>
However this can be achieved<BR>
through the BR command (meaning BREAK) which breaks the line without<BR>
inserting a blank line following it.<BR>
Thus unaligned lines are paragraphs can we created.<P>
It's your choice.<P>
</BODY>
</HTML>
Note that the effects of the two commands are different.
Now you know how to create titles and how to insert text in the HTML page. With this knowledge alone, you can write documents in the same way you do with your text editor. Let's now learn some ways to improve the appearance of the text.
Share This Post




No comments:
Post a Comment
If you have any doubts. Please let me know.