This is a Blue Heading

body {background-color: powderblue;} h1 {color: blue;} p {color: red;}

This is a heading

This is a paragraph.

h1 { color: blue; font-family: verdana; font-size: 300%; } p { color: red; font-family: courier; font-size: 160%; } p { border: 1px solid powderblue; } p { border: 1px solid powderblue; padding: 30px; } p { border: 1px solid powderblue; margin: 50px; }

I am different

#p01 { color: blue; }

I am different

p.error { color: red; } link text Visit our HTML tutorial HTML Images a:link { color: green; background-color: transparent; text-decoration: none; } a:visited { color: pink; background-color: transparent; text-decoration: none; } a:hover { color: red; background-color: transparent; text-decoration: underline; } a:active { color: yellow; background-color: transparent; text-decoration: underline; } Visit W3Schools! HTML5 tutorial! HTML tutorial Visit our HTML Tutorial

Chapter 4

Jump to Chapter 4 Jump to Chapter 4 HTML tutorial HTML tutorial HTML tutorial HTML tutorial Italian Trulli Girl in a jacket Flowers in Chania Flowers in Chania Flowers in Chania Girl in a jacket Girl in a jacket img { width: 100%; } HTML5 Icon HTML5 Icon W3Schools.com Computer Man HTML tutorial

Smiley face The image will float to the right of the text.

Smiley face The image will float to the left of the text.

Workplace Computer Phone Coffee

Background Image

...

Flowers
Firstname Lastname Age
Jill Smith 50
Eve Jackson 94
table, th, td { border: 1px solid black; } table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 15px; } th { text-align: left; } table { border-spacing: 5px; }
Name Telephone
Bill Gates 55577854 55577855
Name: Bill Gates
Telephone: 55577854
55577855
Monthly savings
Month Savings
January $100
February $50
Firstname Lastname Age
Eve Jackson 94
table#t01 { width: 100%; background-color: #f1f1c1; } table#t01 tr:nth-child(even) { background-color: #eee; } table#t01 tr:nth-child(odd) { background-color: #fff; } table#t01 th { color: white; background-color: black; }'
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
  1. Coffee
  2. Tea
  3. Milk
Coffee
- black hot drink
Milk
- white cold drink
  1. Coffee
  2. Tea
  3. Milk
ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 16px; text-decoration: none; } li a:hover { background-color: #111111; }
Hello
World
Hello World

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.

My Important Heading

.city { background-color: tomato; color: white; padding: 10px; }

London

London is the capital of England.

Paris

Paris is the capital of France.

Tokyo

Tokyo is the capital of Japan.

function myFunction() { var x = document.getElementsByClassName("city"); for (var i = 0; i < x.length; i++) { x[i].style.display = "none"; }

London

Paris

Tokyo

Paris

Paris is the capital of France

#myHeader { background-color: lightblue; color: black; padding: 40px; text-align: center; }

My Header

/* Style the element with the id "myHeader" */ #myHeader { background-color: lightblue; color: black; padding: 40px; text-align: center; /* Style all elements with the class name "city" */ .city { background-color: tomato; color: white; padding: 10px; }

My Cities

London

London is the capital of England.

Paris

Paris is the capital of France.

Tokyo

Tokyo is the capital of Japan.

function displayResult() { document.getElementById("myHeader").innerHTML = "Have a nice day!"; }

Chapter 4

Jump to Chapter 4 Jump to Chapter 4

W3Schools.com