You are on page 1of 3

What is HTML?

The language for building web pages HTML

is the standard markup language for creating Web pages.

With HTML you can create your own Web site.

HTML stands for Hyper Text Markup Language.

HTML describes the structure of Web pages using markup.

HTML elements are the building blocks of HTML pages.

HTML elements are represented by tags.

HTML tags label pieces of content such as:

"heading", "paragraph", "table", and so on.

Browsers do not display the HTML tags,

but use them to render the content of the page.

The <!DOCTYPE html> declaration defines this document to be HTML5.

The <html> element is the root element of an HTML page.

The <head> element contains meta information about the document.

The <title> element specifies a title for the document.

The <body> element contains the visible page content.

The <h1> element defines a large heading.

The <p> element defines a paragraph.

Web Browsers

The purpose of a web browser (Chrome, IE, Firefox, Safari)

is to read HTML documents and display them.

The browser does not display the HTML tags,

but uses them to determine how to display the document:

HTML Tags

HTML tags are element names surrounded by angle brackets.

HTML tags normally come in pairs like <p> and </p>

The first tag in a pair is the start tag,

the second tag is the end tag


The end tag is written like the start tag,

but with a forward slash inserted before the tag name

The start tag is also called the opening tag,

and the end tag the closing tag.

HTML <!DOCTYPE> Declaration

The <!DOCTYPE> declaration

must be the very first thing

in your HTML document,

before the <html> tag.

The <!DOCTYPE> declaration is not an HTML tag;

it is an instruction to the web browser

about what version of HTML the page is written in.

In HTML 4.01, the <!DOCTYPE> declaration refers to a DTD,

because HTML 4.01 was based on SGML.

The DTD specifies the rules for the markup language,

so that the browsers render the content correctly.

HTML5 is not based on SGML,

and therefore does not require a reference to a DTD.

Tip: Always add the <!DOCTYPE> declaration to your HTML documents,

so that the browser knows what type of document to expect.

HTML <html> Tag

The <html> tag tells the browser that this is an HTML document.

The <html> tag represents the root of an HTML document.

The <html> tag is the container for all other HTML elements

(except for the <!DOCTYPE> tag).

HTML <head> Tag

The <head> element is a container for all the head elements.

The <head> element can include a title for the document,

scripts, styles, meta information, and more.

HTML <body> Tag

The <body> tag defines the document's body.

The <body> element contains all the contents of an HTML document,


such as text, hyperlinks, images, tables, lists, etc.

HTML <h1> to <h6> Tags

The <h1> to <h6> tags are used to define HTML headings.

<h1> defines the most important heading.

<h6> defines the least important heading.

HTML <button> Tag

The <button> tag defines a clickable button.

Inside a <button> element you can put content, like text or images.

This is the difference between this element

and buttons created with the <input> element.

Different browsers use different default types for the <button> element.

HTML <p> Tag

The <p> tag defines a paragraph.

Browsers automatically add some space (margin)

before and after each <p> element.

The margins can be modified with CSS (with the margin properties).

HTML <style> Tag

The style attribute specifies an inline style for an element.

The style attribute will override any style set globally,

e.g. styles specified in the <style> tag or in an external style sheet.

HTML <!--...--> Tag

The comment tag is used to insert comments in the source code.

Comments are not displayed in the browsers.

You can use comments to explain your code,

which can help you when you edit the source code at a later date.

This is especially useful if you have a lot of code.

HTML <script> Tag

The <script> tag is used to define a client-side script (JavaScript).

The <script> element either contains scripting statements,

or it points to an external script file through the src attribute.

Common uses for JavaScript are:

image manipulation, form validation, and dynamic changes of content.

You might also like