HTML (English) 04 - සාමාන්‍යපෙළ තොරතුරු හා සන්නිවේදන තාක්ෂණය

HTML (English) 04



Titles do not a story make.  You can add regular text to your page just by typing.  Text that is not bracketed by some other type of tag is displayed as normal text.  Jumbo wanted to use this feature to display few sayings to ensure that the positive feelings keep on rolling.  Unfortunately, he’s not too positive about the results.  What went wrong?  As you can see from the Listing, he put the two sentences on separate lines, but the browser crunched them together.


Remember, HTML doesn’t describe how something will appear, but describes what kind of thing it is.  By not putting a tag around his accumulated wisdom, Jumbo was telling the browser that this was just text and leaving it up to the browser to make do.  Does that mean that you have to be content with text that just runs together?  Not at all.  One of the tags you can insert is the paragraph, or <P> tag.  Unlike most of the other tags, the <P> tag has traditionally stood alone, not requiring a closing </P> tag.  Because of this, some older browsers don’t handle the </P> tag properly.  Experiment to see how your favorite browser handles it, and choose whether to include it in your own documents.  Listing 1-3 shows Jumbo’s revised HTML page including <P> tags.


 Listing 1-3 Paragraphs.html




<TITLE>Jumbo’s Jungle Java Joint – Home Page</TITLE>



<H1> Jumbo’s Jungle Java Joint </H1>

  <h2>Welcome to Jumbo’s </H2>

<H3> Our Primo Daily Specials </H3>

<H4> Business Class Specials</H4>

<H5> All- You –Can- Drink Specials </H5>

The all –You –Can-Drink Specials

Are especially attractive to those on a budget

Or those who desire to make their in come stretch

As far as possible.

<P>White not exactly premium blend, the

all –you-Can-drink specials are as richly brown as

the finest Java.

<P>After a single cup, You’ll agree You’ve had all

you Can drink.

<H6>Jumbo’s Complaint  Department</H6>

If you Wish to Complain, go elsewhere!<P>Jumbo’s is a

Negative-Free  Zone!



That’s better. Notice that you can actually Put the <P>tag anywhere, and the paragraph break will take place at that point. The only problem with this page is that there is a little too much space between the pithy sayings at the bottom of the page. Actually, all of the paragraphs have a lot of vertical space inserted whenever a paragraph starts. If you want to prevent the browser from wrapping text into a single line, but don’t want the extra vertical space that comes with using the <P> tag, use the <BR> tag, explained next.




The <BR> tag tells the browser to break the line at the indicated point. See jumbo’s HTML file in listing 1-4and its result in figure1-22.


Listing 1-4 Breaks.html



<TITLE>jumbo’s jungle java joint- Home page </TITLE>



<H1>jumbo’s jungle java joint    </H1>

<H2>welcome to jumbo’s           </H2>

<H3>our primo Deity specials     </H3>

<H4> Business class specials          </H4>

<H5> All-You – Can –drink specials </H5>

The all-you –can –drink specials

Are especially attractive to those on a budget

Or those who desire to make their income stretch

as for as possible. While not exactly premium blend,

The all-you–can-drink specials are as richly brown as

the finest java. <BR> after a single cup, you’ll

Agree you’ve had all you can drink.

<H6>jumbo’s complaint Department               </H6>

If you wish to complain, go elsewhere!          <BR>

Jumbo’s is a negative –free zone!