Paragraphs

If you wanna show your contents on the webpage, surely, paragraph tag is very essential part of your webpage. If you would have been crazy enough , you would have typed several lines in your webpage like this . Concentrate on the p tag :-


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml">	
<head>
My first webpage



</head>
<body>

This is my first webpage. Lets see how it looks . Its amazing I am very happy.

</body> </html>

I know you expected the contents in the way it is written in the notepad++, but oops its showing all the three in same line. Argh.... thats too bad, it neither shows the contents in new line, nor the spaces.

This is because browsers do not emphasize on the exact line of the code or the spaces you have provided. Giving a single space s same as putting a number of spaces.So, we have to work it out by our own.

To change the line, we can use a br tag inside the paragraph or we can close and start a new paragraph tag. This can be done as shown

// Method 1

This is my first webpage.
Lets see how it looks . Its amazing
I am very happy.

// Method 2

This is my first webpage.

Lets see how it looks . Its amazing

I am very happy.

// However, the first one is preferable.

So, replace the p tag of your body with the new formatted ones and check the file again in a browser. Hmm....pretty cool atleast the new lines are working now, but what about the spaces, still not there :'(

There is a trick for that too.

This is my first webpage.
Lets see how it looks. &nbsp;&nbsp;nbsp;&nbsp; Its amazing
I am very happy.

Replace your p tag again and now it will work for you. Notice that we have used non-breaking space for solving the problem. So, for now , I hope you can indent your paragraph in any way you wish. Later on, we will learn how to do these all using CSS

You can further emphasize your keywords in the paragraph using em , strong or bold tags.

This is my first webpage.
Lets see how it looks. &nbsp;&nbsp;nbsp;&nbsp; Its amazing
I am very happy.

Tell me one thing, does that paragraph shown above is different from previous ones. The answer is NO because I have not used a br tag . I have just changed the line in my text editor, that will not change the way browser looks at them.

We will now see how can we play with our contents now

Member Login

Member Login




Not a Member? Sign Up!




Login to comment

Be the first to comment on this topic







  


<<< Wanna review

Continue >>>