HyperText Markup Language is a simple, elegant way to structure content.
In 1980, physicist Tim Berners-Lee, a contractor at CERN, proposed and prototyped ENQUIRE, a system for CERN researchers to use and share documents.
In 1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system.
Berners-Lee specified HTML and wrote the browser and server software in late 1990.
The first publicly available description of HTML was a document called "HTML Tags", first mentioned on the Internet by Tim Berners-Lee in late 1991.
It describes 18 elements comprising the initial, relatively simple design of HTML.
Except for the hyperlink tag, these were strongly influenced by SGMLguid, an in-house Standard Generalized Markup Language (SGML)-based documentation format at CERN.
<html>
<head>
</head>
<body>
</body>
</html>
<b> Hellow </b>
Attributes provide additional information about the contents of an element. They appear on the opening tag of the element and are made up of two parts: a name and a value, separated by an equals sign.
<a href='https://www.google.com'> Google </a>
Attribute Name
Attribute Value
Semantic HTML
In programming, Semantics refers to the meaning of a piece of code — for example "what effect does running that line of JavaScript have?", or "what purpose or role does that HTML element have" (rather than "what does it look like?".)
Why You Should Care About Semantics
Use Semantic Tags Correctly
Some of the most commonly misused semantic tags include:
What's the difference between <b> and <strong>, <i> and <em>?
Some of the benefits from writing semantic markup are as follows:
Ask Yourself
When approaching which markup to use, ask yourself,
You met the element in the first example we created. Everything inside this element is shown inside the main browser window
<body>
<!-- All the content that is viewable in browser goes here -->
</body>
<head>
<title> Hellow World </title>
...
</head>
The HTML <head> element provides general information (metadata) about the document, including its title and links to its scripts and style sheets.
Elements that can be used inside a <head> element:
The HTML Title element (<title>) defines the document's title that is shown in a browser's title bar or a page's tab. It only contains text and tags within the element are ignored.
<title>Awesome page title</title>
The HTML <base> element specifies the base URL to use for all relative URLs contained within a document.
There can be only one <base> element in a document.
<link href="main.css" rel="stylesheet">
Text
<link href="default.css" rel="stylesheet" title="Default Style">
<link href="fancy.css" rel="alternate stylesheet" title="Fancy">
<link href="basic.css" rel="alternate stylesheet" title="Basic">
The HTML <style> element contains style information for a document, or part of a document. It contains CSS, which is applied to the contents of the document containing the <style> element.
The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <title>.
<h1>This is a Main Heading</h1>
<h2>This is a Level 2 Heading</h2>
<h3>This is a Level 3 Heading</h3>
<h4>This is a Level 4 Heading</h4>
<h5>This is a Level 5 Heading</h5>
<h6>This is a Level 6 Heading</h6>
HTML has six "levels" of headings:
<p>A paragraph consists of one or more sentences
that form a self-contained unit of discourse. The
start of a paragraph is indicated by a new
line.</p>
<p>Text is easier to understand when it is split up
into units of text. For example, a book may have
chapters. Chapters can have subheadings. Under
each heading there will be one or more
paragraphs.</p>
To create a paragraph, surround the words that make up the paragraph with an opening tag and closing tag.
By default, a browser will show each paragraph on a new line with some space between it and any subsequent paragraphs.
By enclosing words in the tags we can make characters appear bold.
The element also represents a section of text that would be presented in a visually different way (for example key words in a paragraph) although the use of the element does not imply any additional meaning.
<b>
By enclosing words in the tags we can make characters appear italic.
The element also represents a section of text that would be said in a different way from surrounding content — such as technical terms, names of ships, foreign words, thoughts, or other terms that would usually be italicized.
<i>
<sup>
<sub>
The element is used to contain characters that should be superscript such as the suffixes of dates or mathematical concepts like raising a number to a power such as 2^2 .
The element is used to contain characters that should be subscript. It is commonly used with foot notes or chemical formulas
<p>On the 4<sup>th</sup> of September you will learn
about E=MC<sup>2</sup>.</p>
<p>The amount of CO<sub>2</sub> in the atmosphere
grew by 2ppm in 2009<sub>1</sub>.</p>
<blockquote>
<br />
<q>
<hr />
<strong>
<abbr>
<em>
<cite>
<dfn>
<address>
<ins>
<del>
<s>
<ol>
The ordered list is created with the <ol> element.
<li>
Each item in the list is placed between an opening tag and a closing tag. (The li stands for list item.)
<ol>
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
<li> Item 4 </li>
</ol>
<ul>
The unordered list is created with the <ul> element.
<li>
Each item in the list is placed between an opening tag and a closing tag. (The li stands for list item.)
<ul>
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
<li> Item 4 </li>
</ul>
<dl>
The definition list is created with the <dl> element and usually consists of a series of terms and their definitions.
<dt>
This is used to contain the term being defined (the definition term).
<dl>
<dt>Hellow</dt>
<dd>This message just says
hello to the reader.</dd>
<dt>Scale</dt>
<dd>Something used to measure</dd>
<dd>A technique by which the scales
are removed
from the skin of a fish</dd>
<dt>Scamorze</dt>
<dt>Scamorzo</dt>
<dd>An Italian cheese usually made from whole
cow's milk (although it was traditionally made
from buffalo milk)</dd>
</dl>
<dd>
This is used to contain the definition.
Links are the defining feature of the web because they allow you to move from one web page to another enabling the very idea of browsing or surfing.
You will commonly come across the following types of links:
<a href="https://pesto.tech">PESTO</a>
THIS IS THE PAGE THE
LINK TAKES YOU TO
THIS IS THE TEXT THE
USER CLICKS ON
<a href="../../htmlcode.html">PESTO</a>
This means go two directories
up and look for index.html
<a href="#applications">PESTO</a>
This means scroll the page to someid in the page.
<a href="mailto:ab@gmail.com">Mail</a>
Opens default mail app, and creates
a new mail with the receiver's email
as the one mentioned here
<a href="javascript:void(0)">Mail</a>
This tells the browser to go NOWHERE, but instead execute the valid JavaScript:void(0); function first in the HREF tag
<img src = "images/koala.jpg" alt = "Koala Image" title = "An koala image" />
<p><img src="https://upload...climbing_tree.jpg" alt="Bird" width="100"
height="100" align="right" />There are around
10,000 living species of birds that inhabit
different ecosystems from the Arctic to the
Antarctic. Many species undertake long distance
annual migrations, and many more perform shorter
irregular journeys.</p>
// Horizontal align = "left/right"
// Vertical align = "top/middle/bottom"
<figure>
Images often come with captions. HTML5 has introduced a new <figure> element to contain images and their caption so that the two are associated.
<figcaption>
The <figcaption> element has been added to HTML5 in order to allow web page authors to add a caption to an image.
<figure>
<img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
<figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption>
</figure>
Important Attributes
colspan | th, td | extends a cell to be as wide as 2 or more cells |
rowspan | th, td | extends a cell to be as tall as 2 or more cells |
span | col | Makes the column apply to more to 2 or more columns |
headers | td | space-separated string corresponding to ID’s of the <th> elements relevant to the data |
scope | th | axis of the header |
Deprecated attributes
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
<table>
<thead>
...
</thead>
<tbody>
...
</tbody>
<tfoot>
...
</tfoot>
</table>
HTML forms give you a set of elements to collect data from your users. In this chapter you will learn:
The <input> element is used to create interactive controls for web-based forms in order to accept data from the user.
Important attributes
The <form> element represents a document section containing interactive controls for submitting information.
Important attributes
name
action
enctype
method
novalidate
Text Input
Password
Text Area
Radio Button
Checkbox
Dropdown
Submit Button
Uploading Files
<legend>
<label>
<fieldset>
<meter id="fuel"
min="0" max="100"
low="33" high="66" optimum="80"
value="50">
at 50/100
</meter>
<form oninput="result.value=a.valueAsNumber + b.valueAsNumber">
<input type="range" id="b" name="b" value="50" /> +
<input type="number" id="a" name="a" value="10" /> =
<output name="result" for="a b">60</output>
</form>
<form>
<input type="text" required />
<button type="submit">Submit</button>
</form>
<form>
<input type="email" required />
<input type="url" required />
<button type="submit">Submit</button>
</form>
<form>
<input type="date" required />
<button type="submit">Submit</button>
</form>
<form method="get">
<input list="browsers" name="browser">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
<input type="submit">
</form>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
The <source> element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
<area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
<area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
Downloading progress:
<progress value="22" max="100">
</progress>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
<noscript>Your browser does not support JavaScript!</noscript>
<head>
<base href="https://pesto.tech/images/" target="_blank">
</head>
<body>
<img src="logo.gif" width="24" height="39" alt="Stickman">
<a href="https://pesto.tech">W3Schools</a>
</body>
<bdo dir="rtl">
This text will go right-to-left.
</bdo>
bdo stands for Bi-Directional Override.
The <bdo> tag is used to override the current text direction.
The HTML <canvas> element is used to draw graphics on a web page.
<canvas id="myCanvas" width="200" height="100"></canvas>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0, 0);
ctx.lineTo(200, 100);
ctx.stroke();
<input type="range">
<input type="range" list="tickmarks">
<datalist id="tickmarks">
<option value="0">
<option value="10">
<option value="20">
<option value="30">
<option value="40">
<option value="50">
<option value="60">
<option value="70">
<option value="80">
<option value="90">
<option value="100">
</datalist>
<nav>
<a href="/html/">HTML</a> |
<a href="/css/">CSS</a> |
<a href="/js/">JavaScript</a> |
<a href="/jquery/">jQuery</a>
</nav>
<ul>
<li data-animal-type="bird">Owl</li>
<li data-test="fish">Salmon</li>
<li data-check="spider">Tarantula</li>
</ul>
The draggable attribute specifies whether an element is draggable or not.
Tip: Links and images are draggable by default.
Tip: The draggable attribute is often used in drag and drop operations.
<p contenteditable="true" spellcheck="true">
This is a praggagraph. It is editable.
Try to change the text.
</p>
<p translate="no">Don't translate this!</p>
<p>This can be translated to any language.</p>
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
In computing, quirks mode refers to a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for Internet Explorer 5 and earlier, instead of strictly complying with W3C and IETF standards in standards mode.
<a href="https://web.whatsapp.com/send?text=The text to share!">
WhatsApp
</a>
<a href="whatsapp://send?text=The text to share!">
WhatsApp
</a>
Desktop
Mobile