Home Tutorials Exercises About Us
�I'm unpredictable, I never know where I'm going until I get there, I'm so random, I'm always growing, learning, changing, I'm never the same person twice. But one thing you can be sure of about me; is I will always do exactly what I want to do.� (c) C. JoyBell C.


�A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself. What a man can be, he must be� (c) Abraham Harold Maslow


�I want my kids to have the things in life that I never had when I was growing up. Things like beards and chest hair.� (c) Jarod Kintz, I Want


"Normal is not something to aspire to, it's something to get away from." (c) Jodie Foster


"Common sense is the collection of prejudices acquired by age eighteen." (c) Albert Einstein


"No one can make you feel inferior without your consent." (c) Eleanor Roosevelt

Paragraphs

Go back to your text editor and add another line to your page:


<!DOCTYPE html>
<html>
<head>
    <title>Getting started with my first web page</title>
</head>
<body>
    This is my first web page
    Such amazing
</body>
</html>

Look at the document in your browser.

You might have expected your document to appear as you typed it, on two lines, but instead you should see something like this:

This is my first web page Such amazing.

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 (you would get the same result if you typed “This is my first web page       How exciting”).

If you want text to appear on different lines or, rather, if you intend there to be two distinct blocks of text (because, remember, HTML is about meaning, not presentation), you need to explicitly state that.

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


<p>This is my first web page</p>
<p> Such amazing</p>

The p tag is used for paragraphs.

Look at the results of this. The two lines will now appear on two lines because the browser recognizes them as separate paragraphs.

Emphasis

You can emphasize text in a paragraph using em (emphasis) and strong (strong importance).


<p>Yes, that really <em>is</em> exciting. 
<strong>Warning:</strong>
level of excitement may cause head to explode.</p>

Traditionally, browsers will display (em) in italics and (strong)in bold by default but they are not the same as (i) and (b) tags which (although they have been tenuously redefined in HTML5) have their origins in italic and bold - remember - HTML isn’t for presentation. If you want to emphasize something visually (making something italic, for example), you almost certainly want to give it general emphasis. You can’t speak in italics.

Line breaks

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


This is my first web page<br>
Such amazing

There’s no content involved in breaking lines so there is no closing tag.


Related Pages