You are now ready to learn the essence of HTML: elements.
Elements give structure to a HTML document and tells the browser how you want your website to be presented. Generally elements consists of a start tag, some content, and an end tag.
"Tags"?
Tags are labels you use to mark up the begining and end of an element.
All tags have the same format: they begin with a less-than sign "<" and end with a greater-than sign ">".
Generally speaking, there are two kinds of tags - opening tags: <html> and closing tags: </html>. The only difference between an opening tag and a closing tag is the forward slash "/". You label content by putting it between an opening tag and a closing tag.
HTML is all about elements. To learn HTML is to learn and use different tags.
Can you show me some examples?
Okay, the element em
emphasis text. All text between the opening tag <em>
and the closing tag </em>
is emphasised in the browser. ("em" is short for "emphasis".)
Example 1:
<em>Emphasised text.</em>
Will look like this in the browser:
Emphasised text.
The elements
h1
, h2
, h3
, h4
, h5
and h6
is used to make headings (h stands for "heading"), where h1
is the first level and normally the largest text, h2
is the second level and normally slightly smaller text, and h6
is the sixth and last in the hierarchy of headings and normally the smallest text.
Example 2:
<h1>This is a heading</h1>
<h2>This is a subheading</h2>
Will look like this in the browser:
No comments:
Post a Comment