Thursday, October 21, 2010

Paragraphs

Now that you have the basic structure of an HTML document, you can mess about with the content a bit.

Type the following code in the notepad

  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

  • "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  • <html>

  • <head>

  • <title>My first web page</title>

  • </head>

  • <body>

  • This is the first page

  • It’s the second line.

  • </body>

  • </html>

You will get the following result.

  • This is the first page It’s the second line.

This is because web browsers don't usually take any notice of what line your code is on. It also doesn't take any notice of spaces

If you want text to appear on different lines, you need to explicitly state that.

Change your two lines of content so that they look like this:

  • <P>This is the first page</p>

  • <P> It’s the second line. </p>

The <P> Tag is for a paragraph. And when you use it will make every paragraph in it its place. So the result will be

This is the first page

It’s the second line.

2 – Emphasis.

  • You can emphasis text in a paragraph using em (emphasis) and strong (strong emphasis). These are two ways of doing pretty much the same thing, although traditionally, browsers display em in italics and strong in bold.

  • For example:

  • <p>Ooh, <em>You </em> are <strong>so late</strong></p>

  • <em> You </em> = you

  • <strong> so late </strong> = so late

3 – Line breaks. <br />

  • The line-break tag can also be used to separate lines like this:

  • This is the first page <br />

  • It’s the second line.

0 comments:

Post a Comment

 

Popular Posts

W3OnSet Copyright © 2011 Community is Designed by Sacha Blogger Template

CSS done by Link building