Playing Again

This is a heading

This is a paragraph.

This is a paragraph.

This is a paragraph.

I am different.

I am different.

This is a paragraph.

I am different too.

HTML Links

Visit our HTML tutorial

HTML Images is a link to a page on this website.

W3C is a link to a website on the World Wide Web.

Link Colors

You can change the default colors of links

HTML Images

The target Attribute

Visit our HTML tutorial!

If you set the target attribute to "_blank", the link will open in a new browser window or tab.

Locked in a frame? Click here!

Image Links

The image is a link. You can click on it.

HTML tutorial

We have added "border:0" to prevent IE9 (and earlier) from displaying a border around the image.

Link Titles

The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.

Visit our HTML Tutorial

Jump to Chapter 4

Chapter 1

This chapter explains ba bla bla

Chapter 2

This chapter explains ba bla bla

Chapter 3

This chapter explains ba bla bla

Chapter 4

This chapter explains ba bla bla

Chapter 5

This chapter explains ba bla bla

Chapter 6

This chapter explains ba bla bla

Chapter 7

This chapter explains ba bla bla

Chapter 8

This chapter explains ba bla bla

Chapter 9

This chapter explains ba bla bla

Chapter 10

This chapter explains ba bla bla

Chapter 11

This chapter explains ba bla bla

Chapter 12

This chapter explains ba bla bla

Chapter 13

This chapter explains ba bla bla

Chapter 14

This chapter explains ba bla bla

Chapter 15

This chapter explains ba bla bla

Chapter 16

This chapter explains ba bla bla

Chapter 17

This chapter explains ba bla bla

Chapter 18

This chapter explains ba bla bla

Chapter 19

This chapter explains ba bla bla

Chapter 20

This chapter explains ba bla bla

Chapter 21

This chapter explains ba bla bla

Chapter 22

This chapter explains ba bla bla

Chapter 23

This chapter explains ba bla bla

External Paths

This example uses a full URL to link to a web page:

HTML tutorial

External Paths

This example links to a page located in the html folder on the current web site:

HTML tutorial

External Paths

This example links to a page located in the same folder as the current page:

HTML tutorial

HTML Image

Trulli

HTML Image

Girl in a jacket

HTML Image

Flowers in Chania

HTML Image

Girl in a jacket

HTML Image

Flowers in Chania

Alternative text

The alt attribute should reflect the image content, so users who cannot see the image gets an understanding of what the image contains:

Flowers in Chania

Border Spacing

Border spacing specifies the space between the cells.

Left-align Headings

To left-align the table headings, use the CSS text-align property.

Cellpadding

Cell padding specifies the space between the cell content and its borders.

Collapsed Borders

If you want the borders to collapse into one border, add the CSS border-collapse property.

Basic HTML Table

Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80

Try to change the padding to 5px.

Cell that spans two columns

To make a cell span more than one column, use the colspan attribute.

Name Telephone
Bill Gates 55577854 55577855

Cell that spans two rows

To make a cell span more than one row, use the rowspan attribute.

Name: Bill Gates
Telephone: 55577854
55577855

Table Caption

To add a caption to a table, use the caption tag.

Monthly savings
Month Savings
January $100
February $50

Styling Tables

Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80

Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
John Doe 80

An Unordered HTML List

An Ordered HTML List

  1. Coffee
  2. Tea
  3. Milk

An unordered HTML list

Unordered List with Disc Bullets

Unordered List with Circle Bullets

Unordered List with Square Bullets

Unordered List without Bullets

An ordered HTML list

  1. Coffee
  2. Tea
  3. Milk

Ordered List with Numbers

  1. Coffee
  2. Tea
  3. Milk

Ordered List with Numbers

  1. Coffee
  2. Tea
  3. Milk

Ordered List with Lowercase Letters

  1. Coffee
  2. Tea
  3. Milk

Ordered List with Roman Numbers

  1. Coffee
  2. Tea
  3. Milk

Ordered List with Lowercase Roman Numbers

  1. Coffee
  2. Tea
  3. Milk

A Description List

Coffee
- black hot drink
Milk
- white cold drink

A Nested List

List can be nested (lists inside lists):

The start attribute

By default, an ordered list will start counting from 1. Use the start attribute to start counting from a specified number:

  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk

Navigation Menu

In this example, we use CSS to style the list horizontally, to create a navigation menu:

Hello
World

The DIV element is a block element, and will start on a new line.

Hello World

The SPAN element is an inline element, and will not start on a new line.

London

London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.

Standing on the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Romans, who named it Londinium.

My Important Heading

The class Attribute

Use CSS to style elements with the class name "city":

London

London is the capital of England.

Paris

Paris is the capital of France.

Tokyo

Tokyo is the capital of Japan.

Using The class Attribute in JavaScript

Click the button, to hide all elements with the class name "city", with JavaScript:

London

London is the capital of England.

Paris

Paris is the capital of France.

Tokyo

Tokyo is the capital of Japan.

Multiple Classes

All three headers have the class name "city". In addition, London also have the class name "main", which center-aligns the text.

London

Paris

Tokyo

Same Class, Different Tag

Even if the two elements do not have the same tag name, they can have the same class name, and get the same styling:

Paris

Paris is the capital of France.

The id Attribute

Use CSS to style an element with the id "myHeader":

My Header

Difference Between Class and ID

An HTML page can only have one unique id applied to one specific element, while a class name can be applied to multiple elements.

My Cities

London

London is the capital of England.

Paris

Paris is the capital of France.

Tokyo

Tokyo is the capital of Japan.

Using The id Attribute in JavaScript

JavaScript can access an element with a specified id by using the getElementById() method:

Hello World!

Jump to Chapter 4

Chapter 1

This chapter explains ba bla bla

Chapter 2

This chapter explains ba bla bla

Chapter 3

This chapter explains ba bla bla

Chapter 4

This chapter explains ba bla bla

Chapter 5

This chapter explains ba bla bla

Chapter 6

This chapter explains ba bla bla

Chapter 7

This chapter explains ba bla bla

Chapter 8

This chapter explains ba bla bla

Chapter 9

This chapter explains ba bla bla

Chapter 10

This chapter explains ba bla bla

Chapter 11

This chapter explains ba bla bla

Chapter 12

This chapter explains ba bla bla

Chapter 13

This chapter explains ba bla bla

Chapter 14

This chapter explains ba bla bla

Chapter 15

This chapter explains ba bla bla

Chapter 16

This chapter explains ba bla bla

Chapter 17

This chapter explains ba bla bla

Chapter 18

This chapter explains ba bla bla

Chapter 19

This chapter explains ba bla bla

Chapter 20

This chapter explains ba bla bla

Chapter 21

This chapter explains ba bla bla

Chapter 22

This chapter explains ba bla bla

Chapter 23

This chapter explains ba bla bla

HTML Iframes

You can use the height and width attributes to specify the size of the iframe:

HTML Iframes

You can also use the CSS height and width properties to specify the size of the iframe:

Remove the Iframe Border

To remove the default border of the iframe, use CSS:

Custom Iframe Border

With CSS, you can also change the size, style and color of the iframe's border:

Iframe - Target for a Link

W3Schools.com

When the target of a link matches the name of an iframe, the link will open in the iframe.