Introduction To HTML
Introduction To HTML
OBJECTIVES
Its Role
HTML tells browsers how to display the contents of a web page, using special instructions
- called tags that instruct the browser when to start a paragraph, italicize a word, or display
a picture.
To create your own web pages, you need to learn to use this family of tags.
HTML tags are formatting instructions that tell a browser how to transform ordinary text into
something visually appealing.
Today, most web developers use the HTML5 doctype, which looks like this
<!DOCTYPE html>
<html>
This element wraps everything (other than the doctype) in your web page.
<head>
This element designates the header portion of your document. The header can include:
<title>
<body>
This element holds the actual content you want to display to the world.
Inserting Images
A picture can say a thousand words, and great images help make the difference between an averagelooking site and a really engaging one.
To insert an image
Adding Links
Links are the defining feature of the web because they allow you to move from one web page to
another.
Links are created using the <a> element.
HTML Tags
HTML tags are formatting instructions that tell a browser how to transform ordinary text into
something visually appealing.
Whats in a Tag?
You can recognize a tag by looking for angle brackets. Like this one
Whats in a Tag?
Most start tags are paired with a matching end tag that switches off the effect.
Understanding Elements
This combination of start and end tags and the text in between them makes up an HTML element.
Types of Elements
CONTAINER ELEMENTS
STANDALONE ELEMENTS
<p> </p>
<img/>
<br/>
Nesting Elements
You can also nest one element inside another. In fact, nesting elements is one of the basic building
block techniques of web pages.
Heres an example:
This <b><i>word</i></b> has italic and bold formatting.
Attributes
Attributes provide additional information about the contents of an element. They appear on the opening tag of the
element and are made up of two parts:
a name and a value, separated by an equals sign.
Attributes
BLOCK ELEMENTS
INLINE ELEMENTS
Some elements will always appear to continue on the same line as their neighbouring elements.
A paragraph consists of one or more sentences that form a self-contained unit of discourse
Headings
Horizontal Rule
<hr/>
A horizontal line can help you separate one section of your web page from another.
Unordered List
<ul>
<li>Apple</li>
<li>Banana</li>
</ul>
Italic
This is <i>italic</i>
Line Break
<br />
If you wanted to add a line break inside the middle of a paragraph you can use the line break tag <br
/>.
Image
<img src=dog.jpg/>
To display an image inside a web page, use this element. Make sure you specify the src attribute to
indicate the file name of the picture you want the browser to show.
Anchor
<a href=http://www.google.com>Google</a>
The anchor element is the starting point for creating hyperlinks that let website visitors jump from one
page to another.