• Line Breaks, Paragraphs
As we saw in previous lesson if we break lines in HTML code by simply inserting enter keys (new line characters) ,lines will not break in output result in browser. They will be printed in a single line in browser. We must use <BR> tag to do this as you used it in previous lesson. You can also divide text using paragraphs. A paragraph starts on a new line with one blank line after previous line.
Paragraph tag is <p> </p>
<p>First paragraph</p>
<p>Second paragraph</p>
You will nest other tags inside paragraph tag for fonts, styles and other tags that will be used inside a paragraph.
There is another option in forming text that is using <PRE> tag. Text between <PRE> </PRE> tags will be displayed exactly
as it is typed in html source. Therefore you will not need <BR> tags to break lines. It is enough to
enter text in separate lines with enter key (new line character) at their end.
Space between texts
Browser does not show more than one space between to words even if you have entered a hundred spaces between them in
HTML source. If you want to enter more than one blank character between two words you will need to use a small code for this purpose. It is "&nbsp;" without the quotes.

<BODY>
Here we insert 5 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extra spaces.
</BODY>


  • Paragraph alignments in your web page
You can determine how a paragraph will be aligned in a web page. You can align text in left, right or center of a web page. To specify alignment for a paragraph you must use an extra parameter for your paragraph tag.You can use one of these combinations:
<P ALIGN="left"> </P>
<P ALIGN="center"> </P>
<P ALIGN="right"> </P>
Example:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<P ALIGN="left">You can align text in left.</P>
<P ALIGN="center">You can align text in center.</P>
<P ALIGN="right">You can align text in right.</P>
</BODY>
</HTML>


  • Indented Text
If you need a text that is indented from both sides of web page you can use <BLOCKQUOTE> tag.
Text that is enclosed in this tag will have a margin from left and right of your web page.
Example:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
We see block quotes here:<BR><BR>
<BLOCKQUOTE>
In cases that you want to emphasis on a paragraph in your
text you can use this tag. It will indent your text from
both sides.
</BLOCKQUOTE>
</BODY>
</HTML>

In the next session we are going to see how we can add images in your web pages.


< page5 Webdesign page7 >

0 comments

Post a Comment

Subscribe to: Post Comments (Atom)