Internet Engineering
03
Introduction · HTML · Body · Semantic Tags · Head · HTML in Practice
Fall 2026 ·
Amirkabir University of Technology
@1995parham
/ does nothing — <div /> does
not close the div
<tagname attrib1="setting" attrib2="setting" ...>
...
</tagname>
id: A unique identifier for the element.
In HTML5 it may be any non-empty string with no whitespace — the old
"must start with a letter" rule was XHTML'sclass: Assign a class to the element,
multiple classes are allowedtitle: Specifies extra information about
an element
<em>I am important</em>
I am a <br /> break
dir="rtl" (e.g., Persian) the
browser starts from the right-top
corner
<!-- ... -->
<blink>still visible</blink>
<!-- This is the “Hello World” Example -->
<html>
<head>
<title>First Example</title>
</head>
<body>
<p> Hello World! </p>
</body>
</html>

< and & start markup, so they cannot be
written directly as text| Character | Coding | Number code |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| ' ' | [1] |   |
| © | © | © |
| λ | λ | λ |
<br />
<strong><em>test</strong></em>
checked="checked", not checked<big>)
renders the enclosed text at a font size one level larger than the
surrounding text.<center>) is a block-level element that displays
its block-level or inline contents centered horizontally within its
containing element.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My test page</title>
</head>
<body>
<img src="images/firefox-icon.png" alt="My test image">
</body>
</html>
<!DOCTYPE html> the doctype<html></html><head></head><meta /><title></title><body></body><html> element represents
the root (top-level element) of an HTML document, so it is also referred
to as the root element.<body> Element represents
the content of an HTML document.<h1>–<h6> elements
represent six levels of section headings.
<h1> is the highest section level
and <h6> is the lowest.<section> element
represents a standalone section — which
doesn't have a more specific semantic
element to represent it — contained within an HTML document.h1-h6).<footer> element
represents a footer for its nearest sectioning content or sectioning
root element. A footer typically contains information about the author
of the section, copyright data or links to related documents.<header> element
represents introductory content, typically a group of introductory or
navigational aids. It may contain some heading elements but also a logo,
a search form, an author name, and other elements.<nav> element represents a
section of a page whose purpose is to provide navigation links, either
within the current document or to other documents. Common examples of
navigation sections are menus, tables of contents, and indexes.<main> element represents
the dominant content of the body. A page has only one visible
<main>.<article> element
represents a self-contained composition that makes sense on its own: a
blog post, a news story, a comment, a product card.<aside> element represents
content only indirectly related to the main content, often shown as a
sidebar.<body> and closing
</body> tags.<p> element represents a
paragraph.<pre> element represents
preformatted text which is
to be presented exactly as written in the
HTML file.<ol> element represents an
ordered list of items — typically rendered as a numbered list.<ul> element represents an
unordered list of items, typically rendered as a bulleted list.<li> element is used to
represent an item in a list.<dl> element represents a
description list.<dt> element) and descriptions
(provided by <dd>
elements).
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
<dl>
<dt>Hello</dt>
<dd>Means salam</dd>
</dl>
<div>) is the generic container for flow content.<span> element is a
generic inline container for phrasing content, which does not inherently
represent anything.<q> element indicates that
the enclosed text is a short inline quotation. Most modern browsers
implement this by surrounding the text in quotation marks.<cite>)
is used to describe a reference to a cited creative work, and must
include the title of that work.<a> element (or anchor
element), with its href attribute,
creates a hyperlink to web pages, files, email addresses (mailto),
locations in the same page (fragment), or anything else a URL can
address.<base> in
<head>, if set)/x): Path
starts from web server root directoryx,
../x): Path starts from current directorymailto for sending emailjavascript to run code — avoid it, use a
<button>rel="noopener" to it)<a> </a> is considered as
link name<a> and before
</a>
<!-- either of these, not both: an id must be unique -->
<a id="section-result">Results</a>
<h2 id="section-result">Results</h2>
To see result <a href="xyz#section-result">click here</a>
<br> element produces a
line break in text (carriage-return).<code> element displays
its contents styled in a fashion intended to indicate that the text is a
short fragment of computer code.<em> element marks text
that has stress emphasis.<strong>) indicates that its contents have strong importance, seriousness, or
urgency.<img> element embeds an
image into the document.src: address of file (local or remote)alt: alternative text, shown if the
image cannot be displayed and read aloud by screen readers<img> is an inline element and
has no caption of its own<figure> +
<figcaption>
<figure>
<img src="gopher.png" alt="the Go gopher" />
<figcaption>The Go gopher, by Renée French</figcaption>
</figure>
<video> and
<audio> elements embed media; no
plugin (Flash) is needed any morecontrols: show the play/pause/volume
bar of the browser<source> children: the
browser plays the first format it supports
<video controls width="480">
<source src="lecture.webm" type="video/webm" />
<source src="lecture.mp4" type="video/mp4" />
Your browser cannot play this video.
</video>
<iframe>
) represents a nested browsing context, embedding another HTML page into
the current one.<noscript> element defines a
section of HTML to be inserted if a script type on the page is unsupported
or if scripting is currently turned off in the browser.<script> element is used to
embed executable code or data; this is typically used to embed or refer to
JavaScript code.<table> </table><tr> </tr><td> </td><th> </th>colspan,
rowspan
<table>
<caption>I am a lonely table</caption>
<thead>
<tr>
<th>Head Col 0</th>
<th>Head Col 1</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 0 Col 0</td>
<td>Row 0 Col 1</td>
</tr>
<tr>
<td>Row 1 Col 0</td>
<td>Row 1 Col 1</td>
</tr>
</tbody>
</table>
| Head Col 0 | Head Col 1 |
|---|---|
| Row 0 Col 0 | Row 0 Col 1 |
| Row 1 Col 0 | Row 1 Col 1 |

formaction and
method attributesaction is a URLmethod is a HTTP method used to send
dataget: User input data is sent through
the query part of URL by HTTP GET methodpost: User input data is sent as the
body of HTTP message by HTTP POST methodgetinput elementstype,
name, and
value attributestype specifies the type of componentname is the name of the componentvalue (except buttons)name=value
(user input or default) of the components in the form are sent to server
(using the
action and
method: POST, GET)type="text"type="password"<input>, we use
<textarea> </textarea>cols &
rows specifies # of columns & rowsget it is even in the URLpost + HTTPS for a password
<form action="https://httpbin.org/get" method="get">
Search:
<input type="text" name="txtSearch" value="" size="20" maxlength="64" />
<br />
Password:
<input type="password" name="pass" value="" size="20" maxlength="64" />
<br />
Text:
<textarea name="inputtext" cols="30" rows="3">
Please enter your message</textarea>
</form>
type="checkbox"checked="checked"<fieldset> </fieldset><legend> </legend>
<form action="https://httpbin.org/get" method="get">
<fieldset>
<legend><em>Web Development Skills</em></legend>
<input type="checkbox" name="skill_1" value="html" />
HTML<br />
<input type="checkbox" name="skill_2" value="xhtml" checked="checked" />
XHTML<br />
<input type="checkbox" name="skill_3" value="css" /> CSS<br />
<input type="checkbox" name="skill_4" value="JavaScript" />
JavaScript<br />
<input type="checkbox" name="skill_5" value="aspnet" />ASP.Net<br />
<input type="checkbox" name="skill_6" />
PHP <br />
<input type="submit" value="Submit" />
</fieldset>
</form>
type="radio"
<form action="https://httpbin.org/get" method="get">
<fieldset>
<legend>University Grade</legend>
<input type="radio" name="grade" value="B" /> BS <br />
<input type="radio" name="grade" value="M" /> MS <br />
<input type="radio" name="grade" value="P" /> PhD <br />
<input type="radio" name="grade" value="PD" /> Post Doc <br />
<input type="submit" value="Submit" />
</fieldset>
</form>
<select name="selname"></select><option value="val"> text </option>value
attribute is omitted, the value is taken from the text content of the
option element.
<form action="https://httpbin.org/get" method="get">
Select color:
<select name="selColor">
<option value="r">Red</option>
<option value="g">Green</option>
<option value="b">Blue</option>
</select>
<input type="submit" value="Submit" />
</form>
<input>type="file"accept= A MIME type to specify default
acceptable file format<form>method="post"enctype="multipart/form-data"<input> element(s) to upload file
data.
<form
action="https://httpbin.org/post"
method="post"
enctype="multipart/form-data"
>
<input type="file" name="fileUpload" accept="image/*" />
<input type="submit" value="Submit" />
</form>
type The default behavior of the
button. Possible values are:"submit": To submit data to server."reset": To reset all inputs to
default values."button": To run client side script."submit" — a
<button> without a type submits the formname of the button, submitted as a
pair with the button’s value as part of the form data.value associated with the
button’s name when it’s submitted with the form data.
<form action="https://httpbin.org/get" method="get">
<input type="text" name="input" value="Default Value" /> <br />
<button type="submit">Submit Me</button><br />
<button type="reset">Reset</button> <br />
<button type="button">Click Me</button> <br />
</form>
<label> element gives an
input its captionfor =
id of the input, or put the input
inside the label
<label for="email">Email</label>
<input type="email" id="email" name="email" required />
<label><input type="checkbox" name="news" /> Send me news</label>
type values: the browser gives a
suitable keyboard or pickeremail,
url, tel,
number,
range,
date,
color,
searchrequired,
min /
max,
maxlength,
patternTab key, hence
the name).<div> — it looks the same in the
browser
<!-- says nothing -->
<div class="top"><div class="menu">...</div></div>
<div class="content">...</div>
<!-- says what each part is -->
<header><nav>...</nav></header>
<main>...</main>
<nav> or
<main>; reader mode and search engines find the
<article><title>)
defines the document's title that is shown in a browser's title bar or a
page's tab.<style> element contains
style information for a document, or part of a document.<base> element specifies the
base URL to use for all relative URLs in a document.<meta> element represents
metadata that cannot be represented by other HTML meta-related elementsauthor: the name of the document's
author.description: a short and accurate
summary of the content of the page. Search engines often show it
under the link in the results.generator: the identifier of the
software that generated the page.keywords: words relevant to the page's
content separated by commas. Google search ignores it (since 2009).
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<!-- The number of seconds until the page should redirect to another -->
<meta http-equiv="refresh" content="3;url=https://www.mozilla.org">
<meta charset="UTF-8">
<meta itemprop="description" content="my description">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link>) specifies relationships between the current document and an external
resource. This element is most commonly used to link to
stylesheets, but is also used to establish
site icons (both "favicon" style icons and
icons for the home screen and apps on mobile devices) among other things.<p> cannot contain a
<div>, so the parser closes the paragraph early
<!-- what you wrote -->
<p>Hello <div>World</div></p>
<!-- the tree the browser builds -->
<p>Hello </p><div>World</div><p></p>
