Now that you
have the basic structure of an HTML document, you can mess with the content a
bit.
Return to the
text editor and add another line to your page:
<! DOCTYPE
html>
<Html>
<Head>
<Title>
My first webpage </ title>
</
Head>
<Body>
This is my
first web page
Interesting
</
Body>
</
Html>
Look at the
document in your browser.
You may have
expected your document to appear as you typed it, in two lines, but instead you
should see something like this:
This is my
first web page. How exiting.
This is
because web browsers usually do not take into account the line in which the
code is located. He also does not take any notice of the spaces (he would get
the same result if he wrote "This is my first web page How
exciting").
If you want
the text to appear on different lines, or rather if you intend to have two
different blocks of text (because, remember, HTML is about meaning, not
presentation), you must explicitly state it.
Change your
two lines of content to look like this:
<P>
This is my first webpage </ p>
<P> How
exciting </ 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.
Think of HTML
content as a book - with paragraphs when appropriate.
Emphasis
You can
emphasize the text in a paragraph using em (emphasis) and strong (strong
emphasis).
<P>
Yes, that really <em> is </ em> exciting. <Strong> Warning:
</ strong> The level of excitement can cause the head to explode. </
P>
Traditionally,
browsers will display em bold and bold in bold by default, but they are not the
same as the i and b tags that (although they have been dimly redefined in
HTML5) have their origins in italics and bold. For your presentation. If you
want to emphasize something visual (by doing something cursive, for example),
you almost certainly want to give it overall emphasis. You can not speak in
italics.
Line breaks
The line
break label can also be used to separate lines like this:
This is my
first web page <br>
Interesting
There is no
content involved in breaking lines so there is no closing tag.
It might be
tempting to use over-used line breaks and br should not be used if two blocks
of text are meant to be separated from each other (because if that's what you
want to do, you probably want the p-tag).

