Class 1 HTML Tags
Class 1 HTML Tags
HTML
HTML stands for Hyper Text Markup Language
With HTML you can create your own Website.
HTML is the standard markup language for creating Web pages
HTML describes the structure of a Web page
HTML consists of a series of elements
What is an HTML Element?
An HTML element is defined by a start tag, some content, and an end tag:
<tagname>Content goes here...</tagname>
HTML Attributes
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
A Simple HTML Document
<!DOCTYPE html>
<html>
<head>
<title>LBS CENTRE</title>
</head>
<body>
<h1>LIST OF COMPUTER COURSES</h1>
<p>PGDCA</p>
<p>DCA</p>
</body>
</html>
OUTPUT
PGDCA
DCA
Example Explained
The <!DOCTYPE html> declaration defines that this document is an HTML document
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's
title bar or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc. It has a start tag <body> and
an end tag </body>.
The <h1> element defines a large heading. It has a start tag <h1> and an end tag </h1>.
HTML Notes Page No.2
The <p> element defines a paragraph. It has a start tag <p> and an end tag </p>.
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration represents the document type, and helps browsers to display web
pages correctly.
It must only appear once, at the top of the page (before any HTML tags).
Headings
HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading:
Example
<html>
<head>
<title>LBS CENTRE</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
</body>
</html>
OUTPUT
This is heading 1
This is heading 2
This is heading 3
Paragraphs
HTML paragraphs are defined with the <p> tag:
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
The style Attribute
The style attribute is used to add styles to an element, such as color, font, size, and more.
Example
<p style="color:red;">This is a red paragraph. <br>And this paragraph is displayed in two
lines</p>
Empty HTML Elements – br tag and hr tag
Elements with no content or end tag.
Line break br tag
Br tag is used to insert a line break. (ie. To move to the next line ).
<p>This is a <br> paragraph with a line break.</p>
Horizontal Rules
HTML Notes Page No.3
The <img> tag should also contain the width and height attributes, which specifies the width and
height of the image (in pixels).