HTML Commands
HTML Commands
HTML document
HTML headings
HTML paragraphs
HTML links
HTML images
Examples explained
1) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
My First Heading
My first paragraph.
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6
3) <!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a paragraph.
This is a paragraph.
This is a paragraph.
4) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a link
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
HTML Attributes
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<h1>About W3Schools</h1>
<p><b>
If you move the mouse over the paragraph above,
the title will display as a tooltip.
</b></p>
</body>
</html>
Rezultati
About W3Schools
If you move the mouse over the paragraph above, the title will display as a
tooltip.
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a link
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
4) <!DOCTYPE html>
<html>
<body>
</html>
Rezultati
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a link
6) <!DOCTYPE html>
<html>
<body>
<h1>About W3Schools</h1>
</p>
<p><b>
your browser will only display the first word from the title.
</b></p>
</body>
</html>
Rezultati
About W3Schools
You cannot omit quotes around an attribute value if the value contains spaces.
If you move the mouse over the paragraph above, your browser will only display
the first word from the title.
HTML Headings
HTML headings
HTML horizontal rules
HTML head
Examples explained
1) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6
2) <!DOCTYPE html>
<html>
<body>
<hr>
<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a paragraph.
This is a paragraph.
This is a paragraph.
3) <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>
Rezultati
HTML Paragraphs
HTML paragraphs
More HTML paragraphs
The use of line breaks in HTML
Poem problems (some problems with HTML formatting)
How to control the line breaks and spaces with the <pre> tag
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a paragraph.
This is a paragraph.
This is a paragraph.
2) <!DOCTYPE html>
<html>
<body>
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<p>
This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>
<p>
The number of lines in a paragraph depends on the size of the browser
window. If you resize the browser window, the number of lines in this
paragraph will change.
</p>
</body>
</html>
Rezultati
This paragraph contains a lot of lines in the source code, but the browser ignores it.
This paragraph contains a lot of spaces in the source code, but the browser ignores it.
The number of lines in a paragraph depends on the size of the browser window. If you
resize the browser window, the number of lines in this paragraph will change.
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is
a para
graph with line breaks
4) <!DOCTYPE html>
<html>
<body>
<p>
</p>
</body>
</html>
Rezultati
My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the
ocean. Oh, bring back my Bonnie to me.
5) <!DOCTYPE html>
<html>
<body>
<pre>
</pre>
</body>
</html>
Rezultati
HTML Styles
HTML styles
HTML background color
HTML text color
HTML text font
HTML text size
HTML text alignment
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<h2 style="color:red;">I am red</h2>
<h2 style="color:blue;">I am blue</h2>
</body>
</html>
Rezultati
I am red
I am blue
2) <!DOCTYPE html>
<html>
<body style="background-color:lightgrey;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
4) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a heading
Thisisaparagraph.
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
6) <!DOCTYPE html>
<html>
<body>
<h1 style="text-align:center;">Centered heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
Centered heading
This is a paragraph.
Examples explained
1) <!DOCTYPE html>
<html>
<body>
Rezultati
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This text is normal.
4) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
6) <!DOCTYPE html>
<html>
<body>
Rezultati
7) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
8) <!DOCTYPE html>
<html>
<body>
</html>
Rezultati
9) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
The del element represent deleted (removed) text. The ins element represent inserted
(added) text.
<html>
<body>
<p>This is <sub>subscripted</sub> text.</p>
</body>
</html>
Rezultati
11)<!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is superscripted
text.
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<p>WWF's goal is to: <q>Build a future where people live in harmony with
nature.</q></p>
</body>
</html>
Rezultati
WWF's goal is to: Build a future where people live in harmony with nature.
2) <!DOCTYPE html>
<html>
<body>
<blockquote cite="http://www.worldwildlife.org/who/index.html">
</blockquote>
</body>
</html>
Rezultati
For 50 years, WWF has been protecting the future of nature. The world's leading
conservation organization, WWF works in 100 countries and is supported by 1.2
million members in the United States and close to 5 million globally.
3) <!DOCTYPE html>
<html>
<body>
Visit us at:<br>
Example.com<br>
USA
</address>
</body>
</html>
Rezultati
4) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
6) <!DOCTYPE html>
<html>
<body>
<p>If your browser supports bi-directional override (bdo), the next line will be written
from right to left (rtl):</p>
</body>
</html>
Rezultati
If your browser supports bi-directional override (bdo), the next line will be written
from right to left (rtl):
This line will be written from right to left
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<p><kbd>File | Open...</kbd></p>
</body>
</html>
Rezultati
File | Open...
2) <!DOCTYPE html>
<html>
<body>
<p>The samp element represents sample output from a computer
program:</p>
<samp>
demo.example.com login: Apr 12 09:10:17
Linux 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-
v6.189
</samp>
</body>
</html>
Rezultati
3) <!DOCTYPE html>
<html>
<body>
<code>
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
</code>
</body>
</html>
Rezultati
4) <!DOCTYPE html>
<html>
<body>
<p>The code element does not preserve whitespace and line-breaks.</p>
<p>To fix this, you can put the code element inside a pre element:</p>
<pre>
<code>
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
</code>
</pre>
</body>
</html>
Rezultati
To fix this, you can put the code element inside a pre element:
var x = 5;
var y = 6;
document.getElementById("demo").innerHTML = x + y;
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
HTML Comments
Hidden comments
Conditional comments
Comments for debugging
Examples explained
1) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
This is a paragraph.
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
Nuk ka
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
Nuk ka
HTML CSS
Examples explained
1) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
2) <!DOCTYPE html>
<html>
<head>
<style>
body {background-color: lightgrey;}
h1 {color: blue;}
p {color: green;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
3) <!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
4) <!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
font-family: verdana;
font-size: 300%;
}
p {
color: red;
font-family: courier;
font-size: 160%;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
Thisisaparagraph.
5) <!DOCTYPE html>
<html>
<head>
<style>
p#p01 {
color: blue;
}
</style>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p id="p01">I am different.</p>
</body>
</html>
Rezultati
This is a paragraph.
This is a paragraph.
This is a paragraph.
I am different.
6) <!DOCTYPE html>
<html>
<head>
<style>
p.error {
color: red;
}
</style>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p class="error">I am different.</p>
<p>This is a paragraph.</p>
<p class="error">I am different too.</p>
</body>
</html>
Rezultati
This is a paragraph.
This is a paragraph.
I am different.
This is a paragraph.
I am different too.
7) <!DOCTYPE html>
<html>
<head>
<style>
p{
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph
This is a paragraph
This is a paragraph
8) <!DOCTYPE html>
<html>
<head>
<style>
p{
border: 1px solid grey;
padding: 10px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph
This is a paragraph
This is a paragraph
9) <!DOCTYPE html>
<html>
<head>
<style>
p{
border: 1px solid grey;
padding: 10px;
margin: 30px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph
This is a paragraph
This is a paragraph
<div style="position:relative;">
<div style="opacity:0.5;position:absolute;left:50px;top:-
30px;width:300px;height:150px;background-color:#40B3DF"></div>
<div
style="opacity:0.3;position:absolute;left:120px;top:20px;width:100px;height:
170px;background-color:#73AD21"></div>
<div style="margin-
top:30px;width:360px;height:130px;padding:20px;border-
radius:10px;border:10px solid #EE872A;font-size:120%;">
<h1>CSS = Styles and Colors</h1>
<div style="letter-spacing:12px;font-
size:15px;position:relative;left:25px;top:25px;">Manipulate Text</div>
<div style="color:#40B3DF;letter-spacing:12px;font-
size:15px;position:relative;left:25px;top:30px;">Colors,
<span style="background-
color:#B4009E;color:#ffffff;"> Boxes</span></div>
</div>
</div>
</body>
</html>
Rezultati
CSS = Styles and Colors
M a n i p u l a t e T e x t
C o l o r s , B o x e s
HTML Links
Examples explained
1) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
<html>
<body>
</body>
</html>
Rezultati
3) <!DOCTYPE html>
<html>
<head>
<style>
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;
</style>
</head>
<body>
</body>
</html>
Rezultati
HTML Images
4) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
HTML Images
5) <!DOCTYPE html>
<html>
<body>
<p>If you set the target attribute to "_blank", the link will open in a new
browser window or tab.</p>
</body>
</html>
Rezultati
If you set the target attribute to "_blank", the link will open in a new browser window
or tab.
6) <!DOCTYPE html>
<html>
<body>
<a href="default.asp">
</a>
<p>We have added "border:0" to prevent IE9 (and earlier) from displaying a border
around the image.</p>
</body>
</html>
Rezultati
The image is a link. You can click on it.
We have added "border:0" to prevent IE9 (and earlier) from displaying a border
around the image.
7) <!DOCTYPE html>
<html>
<body>
<h2>Chapter 1</h2>
<h2>Chapter 2</h2>
<h2>Chapter 3</h2>
<h2>Chapter 6</h2>
<h2>Chapter 7</h2>
<h2>Chapter 8</h2>
<h2>Chapter 9</h2>
<h2>Chapter 10</h2>
<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>
<h2>Chapter 12</h2>
<h2>Chapter 13</h2>
<h2>Chapter 14</h2>
<h2>Chapter 15</h2>
<h2>Chapter 16</h2>
<h2>Chapter 17</h2>
</html>
Rezultati
Jump to Chapter 4
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
8) <!DOCTYPE html>
<html>
<body>
<p>Locked in a frame? <a href="http://www.w3schools.com/html/"
target="_top">Click here!</a></p>
</body>
</html>
Rezultati
9) <!DOCTYPE html>
<html>
<body>
<p>
Send Mail</a>
</p>
<p>(Spaces between words should be replaced by %20 to ensure that the browser will
display the text properly)</p>
</body>
</html>
Rezultati
(Spaces between words should be replaced by %20 to ensure that the browser will
display the text properly)
<html>
<body>
<p>
<a href="mailto:[email protected]?
[email protected]&[email protected]&subject=Sum
mer%20Party&body=You%20are%20invited%20to%20a%20big%20summer
%20party!" target="_top">Send mail!</a>
</p>
<p>(Spaces between words should be replaced by %20 to ensure that the browser will
display the text properly)</p>
</body>
</html>
Rezultati
(Spaces between words should be replaced by %20 to ensure that the browser will
display the text properly)
HTML Images
The Mountain
An image height and width using attributes
An image height and width using CSS
An image height and width using both
An image in another folder
An image with a broken link
An image on another server
Using an image as a link
A moving image
An image map with clickable regions
A floating image
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<h2>Spectacular Mountain</h2>
</body>
</html>
Rezultati
Spectacular Mountain
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
3) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
4) <!DOCTYPE html>
<html>
<head>
<style>
img {
width:100%;
</style>
</head>
<body>
<p>It is better to use the style attribute (instead of the width and height attributes),
because it prevents
</body>
</html>
Rezultati
It is better to use the style attribute (instead of the width and height attributes),
because it prevents internal or external styles sheets to change the original size of an
image:
5) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
6) <!DOCTYPE html>
<html>
<body>
<p>If a browser cannot find an image, it will display the alternate text:</p>
</body>
</html>
Rezultati
7) <!DOCTYPE html>
<html>
<body>
<img src="http://www.w3schools.com/images/w3schools_green.jpg"
alt="W3Schools.com" style="width:104px;height:142px;">
</body>
</html>
Rezultati
8) <!DOCTYPE html>
<html>
<body>
<a href="default.asp">
</a>
<p>Add "border:0;" to prevent IE9 (and earlier) from displaying a border around the
image.</p>
</body>
</html>
Rezultati
Add "border:0;" to prevent IE9 (and earlier) from displaying a border around the
image.
9) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
<html>
<body>
<map name="planetmap">
</map>
</body>
</html>
Rezultati
<html>
<body>
<p>
</p>
<p>
</p>
<p>Please use the CSS float property. The align attribute is deprecated in HTML 4,
and not supported in HTML5.</p>
</body>
</html>
Rezultati
Please use the CSS float property. The align attribute is deprecated in HTML 4, and
not supported in HTML5.
HTML Tables
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<h2>HTML Tables</h2>
<hr>
<h2>1 Column:</h2>
<table>
<tr>
<td>100</td>
</tr>
</table>
<hr>
<table>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
</table>
<hr>
<table>
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
<tr>
<td>700</td>
<td>800</td>
<td>900</td>
</tr>
</table>
<hr>
</body>
</html>
Rezultati
HTML Tables
HTML tables start with a table tag.
1 Column:
100
2) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
</style>
</head>
<body>
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
Jill Smith 50
Eve Jackson 94
John Doe 80
3) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
</style>
</head>
<body>
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
Jill Smith 50
Eve Jackson 94
John Doe 80
4) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
th, td {
padding: 15px;
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
Jill Smith 50
Eve Jackson 94
John Doe 80
5) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
}
th, td {
padding: 5px;
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
th, td {
padding: 5px;
th {
text-align: left;
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
7) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
th, td {
padding: 5px;
text-align: left;
}
</style>
</head>
<body>
<h2>Horizontal Headings:</h2>
<table style="width:100%">
<tr>
<th>Name</th>
<th>Telephone</th>
<th>Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>555 77 854</td>
<td>555 77 855</td>
</tr>
</table>
<h2>Vertical Headings:</h2>
<table style="width:100%">
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th>Telephone:</th>
<td>555 77 854</td>
</tr>
<tr>
<th>Telephone:</th>
<td>555 77 855</td>
</tr>
</table>
</body>
</html>
Rezultati
Horizontal Headings:
Name Telephone Telephone
Bill Gates 555 77 854 555 77 855
Vertical Headings:
Name: Bill Gates
Telephone: 555 77 854
Telephone: 555 77 855
8) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
th, td {
padding: 5px;
text-align: left;
</style>
</head>
<body>
<table style="width:100%">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$50</td>
</tr>
</table>
</body>
</html>
Rezultati
Monthly savings
Month Savings
January $100
February $50
9) <!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border-collapse: collapse;
th, td {
padding: 5px;
text-align: left;
</style>
</head>
<body>
<h2>Cell that spans two columns:</h2>
<table style="width:100%">
<tr>
<th>Name</th>
<th colspan="2">Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>555 77 854</td>
<td>555 77 855</td>
</tr>
</table>
</body>
</html>
Rezultati
</body>
</html>
Rezultati
<table style="width:100%">
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
Jill Smith 50
Eve Jackson 94
John Doe 80
<table>
<tr>
<td>
<p>This is a paragraph</p>
<p>This is another paragraph</p>
</td>
<td>This cell contains a table:
<table>
<tr>
<td>A</td>
<td>B</td>
</tr>
<tr>
<td>C</td>
<td>D</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>This cell contains a list
<ul>
<li>apples</li>
<li>bananas</li>
<li>pineapples</li>
</ul>
</td>
<td>HELLO</td>
</tr>
</table>
</body>
</html>
Rezultati
apples
HELLO
bananas
pineapples
<table style="width:100%">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
<br>
<table id="t01">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
<br>
<table id="t01">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
<table style="width:100%">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
<br>
<table class="names">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
<br>
<table class="names">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Points</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td>
</tr>
</table>
</body>
</html>
Rezultati
Examples explained
1) <!DOCTYPE html>
<html>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
Tea
Milk
2) <!DOCTYPE html>
<html>
<body>
<ul style="list-style-type:disc">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
Tea
Milk
3) <!DOCTYPE html>
<html>
<body>
<ul style="list-style-type:circle">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
o Milk
4) <!DOCTYPE html>
<html>
<body>
<ul style="list-style-type:square">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
Tea
Milk
5) <!DOCTYPE html>
<html>
<body>
<ul style="list-style-type:none">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
Unordered List without Bullets
Coffee
Tea
Milk
6) <!DOCTYPE html>
<html>
<body>
<h2>Ordered List</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
Ordered List
1. Coffee
2. Tea
3. Milk
7) <!DOCTYPE html>
<html>
<body>
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
2. Tea
3. Milk
8) <!DOCTYPE html>
<html>
<body>
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
B. Tea
C. Milk
9) <!DOCTYPE html>
<html>
<body>
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
b. Tea
c. Milk
<html>
<body>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
II. Tea
III. Milk
<html>
<body>
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Rezultati
ii. Tea
iii. Milk
<html>
<body>
<dl>
<dt>Coffee</dt>
</dl>
</body>
</html>
Rezultati
A Description List
Coffee
- black hot drink
Milk
- white cold drink
<html>
<body>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
A Nested List
Coffee
Tea
o Black tea
o Green tea
Milk
<html>
<body>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea
<ul>
<li>China</li>
<li>Africa</li>
</ul>
</li>
</ul>
</li>
<li>Milk</li>
</ul>
</body>
</html>
Rezultati
A Nested List
Coffee
Tea
o Black tea
o Green tea
China
Africa
Milk
<html>
<head>
<style>
ul#menu li {
display:inline;
</style>
</head>
<body>
<h2>Horizontal List</h2>
<ul id="menu">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
<li>PHP</li>
</ul>
</body>
</html>
Rezultati
Horizontal List
HTML CSS JavaScript PHP
<html>
<head>
<style>
ul#menu {
padding: 0;
ul#menu li {
display: inline;
ul#menu li a {
background-color: black;
color: white;
ul#menu li a:hover {
background-color: orange;
</style>
</head>
<body>
<h2>Horizontal List</h2>
<ul id="menu">
<li><a href="/html/default.asp">HTML</a></li>
<li><a href="/css/default.asp">CSS</a></li>
<li><a href="/js/default.asp">JavaScript</a></li>
<li><a href="/php/default.asp">PHP</a></li>
</ul>
</body>
</html>
Rezultati
Horizontal List
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<h2>London</h2>
<p>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.</p>
<p>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.</p>
</div>
</body>
</html>
Rezultati
2) <!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
My Important Heading
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 HTML Classes
Examples explained
1)<!DOCTYPE html>
<html>
<head>
<style>
.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;
</style>
</head>
<body>
<div class="cities">
<h2>London</h2>
<p>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.</p>
<p>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.</p>
</div>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<head>
<style>
div.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;
</style>
</head>
<body>
<div class="cities">
<h2>London</h2>
<p>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.</p>
<p>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.</p>
</div>
<div class="cities">
<h2>Paris</h2>
<p>Situated on the Seine River, it is at the heart of the le-de-France region, also
known as the rgion parisienne.</p>
<p>Within its metropolitan area is one of the largest population centers in Europe,
with over 12 million inhabitants.</p>
</div>
<div class="cities">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area, and the most
populous metropolitan area in the world.</p>
<p>It is the seat of the Japanese government and the Imperial Palace, and the
home of the Japanese Imperial Family.</p>
<p>The Tokyo prefecture is part of the world's most populous metropolitan area
with 38 million people and the world's largest urban economy.</p>
</div>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<head>
<style>
span.note {font-size:120%;color:red;}
</style>
</head>
<body>
</body>
</html>
Rezultati
My Important Heading
This is some important text.
HTML Layout
Examples explained
1)<!DOCTYPE html>
<html>
<head>
<style>
#header {
background-color:black;
color:white;
text-align:center;
padding:5px;
#nav {
line-height:30px;
background-color:#eeeeee;
height:300px;
width:100px;
float:left;
padding:5px;
}
#section {
width:350px;
float:left;
padding:10px;
#footer {
background-color:black;
color:white;
clear:both;
text-align:center;
padding:5px;
</style>
</head>
<body>
<div id="header">
<h1>City Gallery</h1>
</div>
<div id="nav">
London<br>
Paris<br>
Tokyo
</div>
<div id="section">
<h2>London</h2>
<p>London is the capital city of England. It is the most populous city in the United
Kingdom,
<p>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.</p>
</div>
<div id="footer">
Copyright W3Schools.com
</div>
</body>
</html>
Rezultat
City Gallery
London
Paris
Tokyo
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.
Copyright W3Schools.com
2)<!DOCTYPE html>
<html>
<head>
<style>
header {
background-color:black;
color:white;
text-align:center;
padding:5px;
nav {
line-height:30px;
background-color:#eeeeee;
height:300px;
width:100px;
float:left;
padding:5px;
section {
width:350px;
float:left;
padding:10px;
footer {
background-color:black;
color:white;
clear:both;
text-align:center;
padding:5px;
</style>
</head>
<body>
<header>
<h1>City Gallery</h1>
</header>
<nav>
London<br>
Paris<br>
Tokyo
</nav>
<section>
<h1>London</h1>
<p>London is the capital city of England. It is the most populous city in the United
Kingdom,
<p>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.</p>
</section>
<footer>
Copyright W3Schools.com
</footer>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<head>
<style>
table.lamp {
width:100%;
table.lamp th, td {
padding:10px;
table.lamp th {
width:40px;
}
</style>
</head>
<body>
<table class="lamp">
<tr>
<th>
</th>
<td>
</td>
</tr>
</table>
</body>
</html>
Rezultati
HTML IFrame
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<iframe src="demo_iframe.htm"></iframe>
</body>
</html>
Rezultati
HTML head Elements
Examples explained
1)<!DOCTYPE html>
<title>Page Title</title>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
Rezultati
This is a heading
This is a paragraph.
2)<!DOCTYPE html>
<html>
<title>Page Title</title>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
This is a heading
This is a paragraph.
3)<!DOCTYPE html>
<html>
<title>Page Title</title>
<body>
<p>The content of the title element is displayed in the browser tab, in favorites and
in search engine results.</p>
</body>
</html>
Rezultati
The content of the title element is displayed in the browser tab, in favorites and in
search engine results.
4)<!DOCTYPE html>
<html>
<title>Page Title</title>
<style>
body {background-color:yellow;}
p {color:blue;}
</style>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<title>Page Title</title>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<body>
</body>
</html>
Rezultati
<title>Page Title</title>
<script>
function myFunction() {
</script>
<body>
</body>
</html>
Rezultati
8)<!DOCTYPE html>
<html>
<title>Page Title</title>
<body>
<img src="html5.gif">
<p>
Since we have specified a base URL, the browser will look for the image "html5.gif"
at "http://www.w3schools.com/images/html5.gif"
</p>
<p><a href="http://www.w3schools.com">W3Schools</a>
</p>
<p>
The link above opens in a new window. This is because the base target is set to
"_blank".
</p>
</body>
</html>
Rezultati
Since we have specified a base URL, the browser will look for the image "html5.gif"
at "http://www.w3schools.com/images/html5.gif"
W3Schools
The link above opens in a new window. This is because the base target is set to
"_blank".
HTML Scripts
Insert a script
Use of the <noscript> tag
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
</script>
</body>
</html>
Rezultati
Hello JavaScript!
2)<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
</script>
<p>A browser without support for JavaScript will show the text written inside the
noscript element.</p>
</body>
</html>
Rezultati
Hello JavaScript!
A browser without support for JavaScript will show the text written inside the noscript
element.
HTML Forms
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<form>
First name:<br>
<br>
Last name:<br>
</form>
<p>Note that the form itself is not visible.</p>
<p>Also note that the default width of a text input field is 20 characters.</p>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
<form>
</form>
</body>
</html>
Rezultati
Male
Female
Other
3)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name:<br>
<br>
Last name:<br>
<br><br>
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called
"action_page.php".</p>
</body>
</html>
Rezultati
First name:
Mickey
Last name:
Mouse
Submit
If you click the "Submit" button, the form-data will be sent to a page called
"action_page.php".
4)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name:<br>
Last name:<br>
<br><br>
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called
"action_page.php".</p>
<p>Notice that the value of the "First name" field will not be submitted, because
the input element does not have a name attribute.</p>
</body>
</html>
Rezultati
First name:
Mickey
Last name:
Mouse
Submit
If you click the "Submit" button, the form-data will be sent to a page called
"action_page.php".
Notice that the value of the "First name" field will not be submitted, because the input
element does not have a name attribute.
5)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<fieldset>
<legend>Personal information:</legend>
First name:<br>
<br>
Last name:<br>
<br><br>
</fieldset>
</form>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<body>
Name:<br>
E-mail:<br>
Comment:<br>
<input type="text" name="comment" value="your comment"
size="50"><br><br>
</form>
</body>
</html>
Rezultati
E-mail:
your email
Comment:
your comment
Send Reset
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="audi">Audi</option>
</select>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
</textarea>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<datalist id="browsers">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
<input type="submit">
</form>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<br><br>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
7)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php"
oninput="x.value=parseInt(a.value)+parseInt(b.value)">
100 +
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
HTML Input Types
Input type text
Input type password
Input type radio
Input type checkbox
Input type button
Input type number - with restrictions
Input type number - with steps
Input type date - with date picker
Input type date - with restrictions
Input type color - with color picker
Input type range
Input type month
Input type week
Input type time
Input type datetime
Input type datetime-local
Input type email
Input type search
Input type tel
Input type url
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name:<br>
<br>
Last name:<br>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
First name:
Last name:
Submit
2)<!DOCTYPE html>
<html>
<body>
<form action="">
User name:<br>
<br>
User password:<br>
</form>
</body>
</html>
Rezultati
User name:
User password:
3)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
</body>
</html>
Rezultati
Male
Female
Other
Submit
4)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<br>
<br><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
I have a bike
I have a car
Submit
5)<!DOCTYPE html>
<html>
<body>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<body>
<p>
</p>
<form action="action_page.php">
<input type="submit">
</form>
</body>
</html>
Rezultati
7)<!DOCTYPE html>
<html>
<body>
<p>
</p>
<form action="action_page.php">
Quantity:
<input type="submit">
</form>
</p>
</body>
</html>
Rezultati
8)<!DOCTYPE html>
<html>
<body>
<p>
A date picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
Birthday:
<input type="submit">
</form>
</body>
</html>
Rezultati
9)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
<p><strong>Note:</strong>
</body>
</html>
Rezultati
10)<!DOCTYPE html>
<html>
<body>
<p>
A color picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
<input type="submit">
</form>
</html>
Rezultati
11)<!DOCTYPE html>
<html>
<body>
<p>
</p>
Points:
<input type="submit">
</form>
<p>
<b>Note:</b>
</p>
</body>
</html>
Rezultati
12)<!DOCTYPE html>
<html>
<body>
<p>
A date picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
<input type="submit">
</form>
<p><b>Note:</b>
type="month" is not supported in Internet Explorer.
</p>
</body>
</html>
Rezultati
13)<!DOCTYPE html>
<html>
<body>
<p>
A date picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
Select a week:
<input type="submit">
</form>
<p><b>Note:</b>
</p>
</body>
</html>
Rezultati
14)<!DOCTYPE html>
<html>
<body>
<p>
A time picker might pop-up when you enter the input field.
</p>
<form action="action_page.php">
Select a time:
<input type="submit">
</form>
<p><b>Note:</b>
type="time" is not supported in Firefox or Internet Explorer.
</p>
</body>
</html>
Rezultati
15)<!DOCTYPE html>
<html>
<body>
<p>
A date picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
<input type="submit">
</form>
</body>
</html>
Rezultati
16)<!DOCTYPE html>
<html>
<body>
<p>
A date picker can pop-up when you enter the input field.
</p>
<form action="action_page.php">
</form>
<p><b>Note:</b>
type="datetime-local" is not supported in Firefox and Internet Explorer.
</p>
</body>
</html>
Rezultati
17)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
E-mail:
<input type="submit">
</form>
<p>
</body>
</html>
Rezultati
18)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
Search Google:
<input type="submit">
</form>
</body>
</html>
Rezultati
19)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
Telephone:
<input type="submit">
</form>
</body>
</html>
Rezultati
20)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
<p><b>Note:</b>
</body>
</html>
Rezultati
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<input type="submit">
</form>
<p>Fill in and submit the form, then reload the page to see how autocomplete
works.</p>
<p>Notice that autocomplete is "on" for the form, but "off" for the e-mail field.</p>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
<input type="submit">
</form>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name:<input type="text" name="fname" autofocus><br>
<input type="submit">
</form>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
</form>
<p>The "Last name" field below is outside the form element, but still part of the
form.</p>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name: <input type="text" name="fname"><br>
</form>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<body>
</form>
</body>
</html>
Rezultati
7)<!DOCTYPE html>
<html>
<body>
</form>
</body>
</html>
Rezultati
8)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
E-mail: <input type="email" name="userid"><br>
</form>
</body>
</html>
Rezultati
9)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name: <input type="text" name="fname"><br>
</form>
</body>
</html>
Rezultati
10)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
First name: <input type="text" name="fname"><br>
</form>
</body>
</html>
Rezultati
11)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
Webpage: <input type="url" list="url_list" name="link">
<datalist id="url_list">
</datalist>
<input type="submit">
</form>
</body>
</html>
Rezultati
12)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
<p><strong>Note:</strong> The max and min attributes of the input tag is not
supported in Internet Explorer 9 and earlier versions, or in Firefox.</p>
<p><strong>Note:</strong> The max and min attributes will not work for dates
and time in Internet Explorer 10, since IE 10 does not support these input
types.</p>
</body>
</html>
Rezultati
13)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
<p>Try selecting more than one file when browsing for files.</p>
<p><strong>Note:</strong> The multiple attribute of the input tag is not
supported in Internet Explorer 9 and earlier versions.</p>
</body>
</html>
Rezultati
14)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
<p><strong>Note:</strong> The pattern attribute of the input tag is not supported
in Internet Explorer 9 and earlier versions, or in Safari.</p>
</body>
</html>
Rezultati
15)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
</form>
<p><strong>Note:</strong> The placeholder attribute of the input tag is not
supported in Internet Explorer 9 and earlier versions.</p>
</body>
</html>
Rezultati
16)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
</html>
Rezultati
17)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
</html>
Rezultati
17)<!DOCTYPE html>
<html>
<body>
<form action="action_page.php">
<input type="submit">
</form>
</html>
Rezultati
HTML5 Canvas
Examples explained
1)<!DOCTYPE html>
<html>
<body>
</canvas>
<script>
var c = document.getElementById("myCanvas");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0,0,150,75);
</script>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
</script>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
ctx.beginPath();
ctx.arc(95,50,40,0,2*Math.PI);
ctx.stroke();
</script>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
ctx.fillText("Hello World",10,50);
</script>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
ctx.strokeText("Hello World",10,50);
</script>
</body>
</html>
Rezultati
6)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
// Create gradient
grd.addColorStop(0,"red");
grd.addColorStop(1,"white");
ctx.fillStyle = grd;
ctx.fillRect(10,10,150,80);
</script>
</body>
</html>
Rezultati
7)<!DOCTYPE html>
<html>
<body>
<script>
var c = document.getElementById("myCanvas");
// Create gradient
grd.addColorStop(0,"red");
grd.addColorStop(1,"white");
// Fill with gradient
ctx.fillStyle = grd;
ctx.fillRect(10,10,150,80);
</script>
</body>
</html>
Rezultati
8)<!DOCTYPE html>
<html>
<body>
<p>Image to use:</p>
<p>Canvas to fill:</p>
<script>
function myCanvas() {
var c = document.getElementById("myCanvas");
ctx.drawImage(img,10,10);
</script>
</body>
</html>
Rezultati
HTML5 SVG
SVG Circle
SVG Rectangle
SVG Rounded Rectangle
SVG Star
SVG Logo
Examples explained
1)<!DOCTYPE html>
<html>
<body>
</svg>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
style="fill:rgb(0,0,255);stroke-width:10;stroke:rgb(0,0,0)" />
</svg>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
style="fill:red;stroke:black;stroke-width:5;opacity:0.5" />
</svg>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
<svg width="300" height="200">
style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<body>
<stop offset="0%"
style="stop-color:rgb(255,255,0);stop-opacity:1" />
<stop offset="100%"
style="stop-color:rgb(255,0,0);stop-opacity:1" />
</linearGradient>
</defs>
x="50" y="86">SVG</text>
</svg>
</body>
</html>
Rezultati
HTML5 Media
Play Bunny
Play bear video with controls
Play bear video with autoplay
Play Horse sound with controls
Examples explained
1)<!DOCTYPE html>
<html>
<body>
</video>
<p>
Video courtesy of
</p>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
</video>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
</video>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
<audio controls>
</audio>
</body>
</html>
Rezultati
HTML5 Geolocation
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
function showPosition(position) {
</script>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
function showPosition(position) {
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
break;
case error.POSITION_UNAVAILABLE:
break;
case error.TIMEOUT:
break;
case error.UNKNOWN_ERROR:
</script>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
<p id="demo">Click the button to get your position.</p>
<div id="mapholder"></div>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
function showPosition(position) {
+latlon+"&zoom=14&size=400x300&sensor=false";
document.getElementById("mapholder").innerHTML = "<img
src='"+img_url+"'>";
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
break;
case error.POSITION_UNAVAILABLE:
break;
case error.TIMEOUT:
break;
case error.UNKNOWN_ERROR:
break;
</script>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
<div id="mapholder"></div>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
function showPosition(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
mapholder = document.getElementById('mapholder')
mapholder.style.height = '250px';
mapholder.style.width = '500px';
var myOptions = {
center:latlon,zoom:14,
mapTypeId:google.maps.MapTypeId.ROADMAP,
mapTypeControl:false,
navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL}
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
break;
case error.POSITION_UNAVAILABLE:
break;
case error.TIMEOUT:
break;
case error.UNKNOWN_ERROR:
break;
</script>
</body>
</html>
Rezultati
5)<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.watchPosition(showPosition);
} else {
function showPosition(position) {
</script>
</body>
</html>
Rezultati
HTML5 Local Storage
Examples explained
1)<!DOCTYPE html>
<html>
<body>
<div id="result"></div>
<script>
// Store
localStorage.setItem("lastname", "Smith");
// Retrieve
document.getElementById("result").innerHTML =
localStorage.getItem("lastname");
} else {
</script>
</body>
</html>
Rezultati
Smith
2)<!DOCTYPE html>
<html>
<head>
<script>
function clickCounter() {
if (localStorage.clickcount) {
localStorage.clickcount = Number(localStorage.clickcount)+1;
} else {
localStorage.clickcount = 1;
} else {
</script>
</head>
<body>
<div id="result"></div>
<p>Close the browser tab (or window), and try again, and the counter will continue
to count (is not reset).</p>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<head>
<script>
function clickCounter() {
if (sessionStorage.clickcount) {
sessionStorage.clickcount = Number(sessionStorage.clickcount)+1;
} else {
sessionStorage.clickcount = 1;
}
document.getElementById("result").innerHTML = "You have clicked the button
" + sessionStorage.clickcount + " time(s) in this session.";
} else {
</script>
</head>
<body>
<div id="result"></div>
<p>Close the browser tab (or window), and try again, and the counter is reset.</p>
</body>
</html>
Rezultati
More HTML5 Examples
1)<!DOCTYPE HTML>
<html>
<head>
<style>
</style>
<script>
function allowDrop(ev) {
ev.preventDefault();
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
function drop(ev) {
ev.preventDefault();
ev.target.appendChild(document.getElementById(data));
</script>
</head>
<body>
<br>
</body>
</html>
Rezultati
2)<!DOCTYPE html>
<html manifest="demo_html.appcache">
<body>
<script src="demo_time.js"></script>
</body>
</html>
Rezultati
3)<!DOCTYPE html>
<html>
<body>
<script>
var w;
function startWorker() {
if(typeof(w) == "undefined") {
w = new Worker("demo_workers.js");
w.onmessage = function(event) {
document.getElementById("result").innerHTML = event.data;
};
} else {
}
function stopWorker() {
w.terminate();
w = undefined;
</script>
</body>
</html>
Rezultati
4)<!DOCTYPE html>
<html>
<body>
<div id="result"></div>
<script>
source.onmessage = function(event) {
};
} else {
</script>
</body>
</html>
Rezultati
HTML Element Reference
W3Schools Home
Next Reference
Tag Description
<base> Specifies the base URL/target for all relative URLs in a document
<canvas> Used to draw graphics, on the fly, via scripting (usually JavaScript)
<col> Specifies column properties for each column within a <colgroup> ele
<details> Defines additional details that the user can view or hide
<dfn> Represents the defining instance of a term
<noscript> Defines an alternate content for users that do not support client-side
<rp> Defines what to show in browsers that do not support ruby annotatio
<source> Defines multiple media resources for media elements (<video> and
<track> Defines text tracks for media elements (<video> and <audio>)
<u> Defines text that should be stylistically different from normal text
W3Schools Home
Next Reference
W3SCHOOLS EXAMS
COLOR PICKER
LEARN MORE:
Google Maps
Animated Buttons
Modal Boxes
JS Animations
Progress Bars
Dropdowns
HTML Includes
Color Palettes