0% found this document useful (0 votes)
52 views

How To HTML

HTML is the standard markup language used to define the structure of web pages. HTML uses elements represented by tags to describe headings, paragraphs, images, and other content. An HTML document must start with a <!DOCTYPE html> declaration and include <html>, <head>, <body> tags, with the visible content between the <body> tags.

Uploaded by

Luke Baird HD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

How To HTML

HTML is the standard markup language used to define the structure of web pages. HTML uses elements represented by tags to describe headings, paragraphs, images, and other content. An HTML document must start with a <!DOCTYPE html> declaration and include <html>, <head>, <body> tags, with the visible content between the <body> tags.

Uploaded by

Luke Baird HD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

What is HTML?

HTML is the standard markup language for creating Web pages.

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

Tags Explained
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
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).

The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML is:

HTML Documents
All HTML documents must start with a document type
declaration: <!DOCTYPE html>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

Example
<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

HTML Headings
HTML headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important
heading:
Example
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>

HTML Paragraphs
HTML paragraphs are defined with the <p> tag:

Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

HTML Links
HTML links are defined with the <a> tag:

Example
<a href="http://google.com ">This is a link</a>

HTML Images
HTML images are defined with the <img> tag.

The source file (src), alternative text (alt), width, and height are provided as
attributes:

Example
<img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142">

HTML Colors
In HTML, a color can be specified by using a color name, an RGB value, or
a HEX value.
Color Names
In HTML, a color can be specified by using a color name:

Example

Color Name

Red

Orange

Yellow

Cyan

Blue

RGB Value
In HTML, a color can also be specified as an RGB value, using this formula:
rgb(red, green, blue)

Each parameter (red, green, and blue) defines the intensity of the color
between 0 and 255.

For example, rgb(255,0,0) is displayed as red, because red is set to its


highest value (255) and the others are set to 0.

To display the color black, all color parameters must be set to 0, like this:
rgb(0,0,0).

To display the color white, all color parameters must be set to 255, like this:
rgb(255,255,255).
Experiment by mixing the RGB values below:

Red Green Blue

255 0 0

rgb(255, 0, 0)

Example

Color RGB

rgb(255,0,0)

rgb(255,255,0)

rgb(0,255,0)

rgb(0,255,255)

rgb(0,0,255)

Try it Yourself

Shades of gray are often defined using equal values for all the 3 light
sources:
Example

Color RGB

rgb(0,0,0)

rgb(90,90,90)

rgb(128,128,128)

rgb(200,200,200)

rgb(255,255,255)

Try it Yourself

HEX Value
In HTML, a color can also be specified using a hexadecimal value in the form:
#RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal
values between 00 and FF (same as decimal 0-255).

For example, #FF0000 is displayed as red, because red is set to its highest
value (FF) and the others are set to the lowest value (00).

Example

Color HEX
#FF0000

#FFFF00

#00FF00

#00FFFF

#0000FF

Shades of gray are often defined using equal values for all the 3 light
sources:

Example

Color HEX

#000000

#404040

#808080

#CCCCCC
#FFFFFF

You might also like