HTML Notes
HTML Notes
- Hyper text resembles text that contains content beyond what we see.
- The markup is derived from common computer terminology, where “marking up” is the process of
preparing for presenta on.
- Early 1990’s “Tim Berners Lee” introduced “HTML” for “Mosaic” browser.
What is DHTML?
- It is a markup language.
What is DOM?
- Normal Elements
- Void Elements
- RC Data Elements
- Foreign Elements
Normal Elements
- Elements which return a presenta on directly on call back
[without any addi onal a ributes].
Void Elements
- The term void refers to element that doesn’t return any
presenta on directly on call back.
- They can return only the specific content and stop implicitly.
RC Data Elements
- Rich Content Elements
- These elements will not allow any another element with in the
context.
Ex:
<textarea> </textarea>
- You have to import a library that makes the browser compa ble
with element.
Ex:
SVG, MathML, Canvas
<img> - Tag
Anchor - Element
<a> - Tag
Bold - Element
<b> - Tag
- It informs the parser that we are using HTML 5 to design web page.
Note: Comments in HTML are wri en with in “<!-- your comments -->”
Document Scope:
- Every document scope must specify which language content it is presen ng.
- The content from memory of browser can be accessed by page or browser when ever required.
- It comprises of contents like o Title o Link o Meta o Script o Style Title Element:
Link Element:
- Save
- Meta Data contains informa on about your page, which is provided to SEO [Search Engine
Op miza on] to make the page more SEO friendly.
- Meta is one of the op ons used in SEO. It Is not only the op on for SEO.
- Meta is also used for Responsive Pages. It is not only the op ons for Responsive.
<!DOCTYPE html>
<!--Document Scope-->
<html lang="en-IN">
<head>
<meta name="keywords" content="Best So ware Traning, Best IT Training, in Hyd, Chennai, US">
</head>
</html>
Body Sec on
A ribute Descrip on
le margin
rightmargi n
topmargin
bo ommar
gin
- HTML 5 body sec on introduced new seman cs that can make body content more SEO friendly.
dialog It is a container, which can popup and allow interac ons with page.
Ex:
<!DOCTYPE html>
<html>
<head>
<style> header
{
} footer
{
</style>
</head>
<body>
<header>
Amazon Shopping
</header>
<div>Latest Updates</div>
<div>News..</div>
</ar cle>
<nav>
<menu>
<div>Home</div>
<div>Electronics</div>
<div>Footwear</div>
<div>Fashion</div>
</menu>
</nav>
<main>
Year End Sale. <span>Amazon offers 50% OFF</span>. Ends on DEC - 30.
</figure>
</main>
<dialog open>
Chat with HR
</dialog>
</sec on>
<footer>
</footer>
</body>
</html> Task:
Ex:
<!DOCTYPE html>
<html>
<head>
<style> header {
font-size: 30px; font-weight:
bold; text-align: center;
background-color: gray;
color:white; padding: 10px;
}
padding: 20px;
</style>
</head>
<body>
<header>
THE HINDU
</header>
<sec on>
<div>
Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
This agreement describes your rights and the condi ons upon which you may use the Windows
so ware. You should review the en re agreement, including any supplemental license terms that accompany
the so ware and any linked terms, because all of the terms are important and together create this agreement
that applies to you. You can review linked terms by pas ng the (aka.ms/) link into a browser window.
Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
This agreement describes your rights and the condi ons upon which you may use the Windows
so ware. You should review the en re agreement, including any supplemental license terms that accompany
the so ware and any linked terms, because all of the terms are important and together create this agreement
that applies to you. You can review linked terms by pas ng the (aka.ms/) link into a browser window.
Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
This agreement describes your rights and the condi ons upon which you may use the Windows
so ware. You should review the en re agreement, including any supplemental license terms that accompany
the so ware and any linked terms, because all of the terms are important and together create this agreement
that applies to you. You can review linked terms by pas ng the (aka.ms/) link into a browser window.
Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
This agreement describes your rights and the condi ons upon which you may use the Windows
so ware. You should review the en re agreement, including any supplemental license terms that accompany
the so ware and any linked terms, because all of the terms are important and together create this agreement
that applies to you. You can review linked terms by pas ng the (aka.ms/) link into a browser window.
</div>
</sec on>
<footer>
<div>
<div>Movie News</div>
<div>Sports</div>
<div>Stock</div>
</div>
<div>
<div>Facebook</div>
<div>Twi er</div>
<div>YouTube</div>
</div>
<div>
<div>[email protected]</div>
<div>www.epaper.com/hindu</div> <div>www.thehindu.com</div>
</div>
<div>
<div>[email protected]</div>
<div>www.epaper.com/hindu</div>
<div>www.thehindu.com</div>
</div>
</footer>
</body>
</html> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<header>
<nav>
<menu>
<div>Home</div>
<div>About</div>
<div>Contact</div>
<div>Login</div>
</menu>
</nav>
</header>
</body>
</html>
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Welcome to HTML.<br>
</html>
- Blank Spaces o Browser ignores addi onal spaces between words and characters.
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
- Pre-forma ed Text o It is used to present the content exactly as defined in source code.
o It will keep the spaces and line breaks are defined in editor.
o The content must be defined with-in “<pre>” element.
Ex:
<!DOCTYPE html>
<html>
<head>
width: 400px;
}
</style>
</head>
<body>
<div>Sample C Program</div>
<div>
<pre>
</pre>
</div>
</body>
</html>
- Code Element o <code> is an element used to define code snippet in web page.
o It allows to browser and SEO to understand that the content enclosed in some computer code.
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<div>Sample C Program</div>
<div>
<pre>
<code>
</code>
</pre>
</div>
</body> </html>
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<code>
</code>
</body> </html>
- The <address> element is used to define your contact details in web page.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<address>
</body>
</html>
Headings in HTML
- Heading can be defined with “align” a ribute, which can align le , center, right or jus fy.
- SEO can iden fy the topics on your page if they are defined in heading.
Note:
- Don’t use too many headings in a page. SEO can SPAM your page.
Ex:
<!DOCTYPE html>
<html>
<head>
<body>
<h1 align="center">HTML</h1>
<h2>Web Terminology</h2>
<h3>Web Site</h3>
<h3>Web Page</h3>
It is a Hypertext document.
</body> </html>
- Data list is a collec on of terms defined with <dt> and defini on defined with <dd> Syntax:
<dl>
<dt>Term</dt>
<dd> Defini on </dd>
<dt> Term </dt>
<dd> Defini on </dd>
<dd> Defini on </dd>
</dl> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<h1 align="center">HTML</h1>
<h2>Web Terminology</h2>
<dl>
<dt>Web Server</dt>
<dt>Web Site</dt>
<dt>Web Page</dt>
</dl>
</body>
</html> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<h2>Product Details</h2>
<dl>
<dt>Product Name</dt>
<dd>Samsung TV</dd>
<dt>Stock Status</dt>
<dd>Available</dd>
</dl>
</body> </html>
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<details open>
<summary>HTML</summary>
HTML is a markup language.Depending on how you obtained the Windows so ware, this is a license
agreement between (i) you and the device manufacturer or so ware installer that distributes the so ware with
your device; or (ii) you and Microso Corpora on (or, based on where you live or, if a business, where your
principal place of business is located, one of its affiliates) if you acquired the so ware from a retailer. Microso
is the device manufacturer for devices produced by Microso or one of its affiliates, and Microso is the
retailer if you acquired the so ware directly from Microso . Note that if you are a volume license customer,
use of this so ware is subject to your volume license agreement rather than this agreement.
</details>
<details>
<summary>CSS</summary>
CSS defines style for HTML elements.Depending on how you obtained the Windows so ware, this is a
license agreement between (i) you and the device manufacturer or so ware installer that distributes the
so ware with your device; or (ii) you and Microso Corpora on (or, based on where you live or, if a business,
where your principal place of business is located, one of its affiliates) if you acquired the so ware from a
retailer. Microso is the device manufacturer for devices produced by Microso or one of its affiliates, and
Microso is the retailer if you acquired the so ware directly from Microso . Note that if you are a volume
license customer, use of this so ware is subject to your volume license agreement rather than this agreement.
</details>
<details>
<summary>JavaScript</summary>
</details>
</body>
</html>
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Amazon Shopping</h2>
<details>
<summary>Electronics</summary>
<dl>
<dd>Televisions</dd>
<dd>Cameras</dd>
<dd>Watches</dd>
</dl>
</details>
<details>
<summary>Footwear</summary>
<dl>
<dd>Sports</dd> <dd>Sneakers</dd>
<dd>Casuals</dd>
</dl>
</details>
</body> </html>
Field Set and Legends
<html>
<head>
<style> legend {
background-color:black;
color:white;
} fieldset { margin-top: 20px;
}
</style>
</head>
<body>
<fieldset>
</fieldset>
<fieldset>
</body>
</html>
- It supports “align” a ribute, which can set text le , center, right or jus fied.
- Blockquote is similar to paragraph but have le and right indenta on for text.
[Indenta on is space between margin and text] - It is defined by using “<blockquote>” element.
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you
and.
</blockquote>
This agreement describes your rights and the condi ons upon which you may use the Windows
so ware. You should review the en re agreement, including any supplemental license terms that
accompany the so ware and any linked terms, because all of the terms are important and together create
this agreement that applies to you. You can review linked terms by pas ng the (aka.ms/) link into a
browser window.
</p>
Microso Corpora on (or, based on where you live or, if a business, where your principal place of
business is located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device
manufacturer for devices produced by Microso or one of its affiliates, and Microso is the retailer if you
acquired the so ware directly from Microso . Note that if you are a volume license customer, use of this
so ware is subject to your volume license agreement rather than this agreement.
</p>
</body>
</html>
- Order List will add auto numbering for a list of op ons, which can update automa cally when you add
or delete items.
Ex:
<body>
<h2>Web Terminology</h2>
<ol>
<li>Internet</li>
<li>Web Server</li>
<li>Web Site</li>
<li>Web Page</li>
</ol>
</body>
- a
- A
- i
- I
- 1
Ex:
<ol type="a">
<li>Internet</li>
<li>Web Server</li>
<li>Web Site</li>
<li>Web Page</li>
</ol>
Ex:
<ol lang="hi" >
<li>Internet</li>
<li>Web Server</li>
<li>Web Site</li>
<li>Web Page</li> </ol>
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Web Terminology</h2>
<ol type="I">
<li>
HTML
<ol type="1">
<li>Normal Elements
</ol>
</li>
<li>Void Elements
<ol type="a">
<li>Line Break</li>
<li>Image</li>
</ol>
</li>
</ol>
</li>
<li>
JavaScript
<ol type="1">
<li>Variables</li>
<li>Data Types</li>
</ol>
</li>
</ol>
</body>
</html>
- Numbering will not con nue the previous list once you end it.
Ex:
<body>
<ol>
<h2>Web Terminology</h2>
<li>Web Site</li>
<li>Web Page</li>
<li>URL</li>
<li>Internet</li>
<li>Web</li>
</ol>
</body>
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<ol>
<li>Home</li>
<li>About</li>
<li>Contact</li>
<li>Signin</li>
<li>Help</li>
</ol>
</body>
</html>
Unordered List
<body>
<ul type="square">
<li>Web Sever</li>
<li>Web Site</li>
<li>Web Page</li>
</ul>
</body>
- It uses “url()” that specifies the name and loca on of image to display.
Ex:
<!DOCTYPE html>
<html>
<head>
<style> ul {
list-style-image: url("../icons/bullet.png");
} li {
font-size: 34px;
</style>
</head>
<body>
<ul>
<li>Web Sever</li>
<li>Web Site</li>
<li>Web Page</li>
</ul>
</body>
</html>
Ex:
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<ul>
<li>Web Sever
<ul>
<li>IIS</li>
</li>
<li>Web Site</li>
<li>Web Page
<ul type="square">
<li>Sta c Page</li>
<li>Dynamic Page</li>
</ul>
</li>
</ul>
</body>
</html>
Ex:
<body>
<ol type="I">
<li>HTML
<ol>
<li>Normal Elements
<ul type="circle">
<li>Bold</li>
<li>Italic</li>
</ul>
</li>
<li>Void Elements
<ul type="circle">
<li>Image</li>
<li>Break</li>
</ul>
</li>
</ol>
</li>
<li>JavaScript</li>
</ol>
</body>
“Fontawesome”
- Extract the ZIP folder and copy all its sub folders
- Paste all the copied sub folders into “Fonts” folder. - Now your project is ready to use “Fontawesome”
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<ul>
</ul>
</body>
</html> Ex:
<!DOCTYPE html>
<html>
<head>
<style>
ul { list-style: none;
width: 140px;
} li{
margin-top: 10px; border-bo om: 1px solid gray; padding:
10px;
} li:hover { background-color: black;
color:white; cursor:grab;
}
</style>
</head>
<body>
<ul>
</ul>
</body>
</html>
- Text forma ng includes changing the font, font style, size, color and effects etc.
Element Descrip on
Ex:
<body>
<font face="Arial" color="red" size="5">Welcome to HTML</font>
</body> Ex:
<body>
</body>
- HTML allows 2 techniques for colors o Color Name / Color Shade Name o Hexadecimal Code
Colors in HTML
- Color Names:
Purple
Silver
White
Darkcyan
Lightcyan
Lightgreen etc..
Ex:
- Hexadecimal Color Code o Hexadecimals colors are basically “RGB” color o R-Red, G-Green, B-Blue
o Hexadecimal number system is 16 base number system, where we use 16 different values
ranging from “0 to F”.
6 Chars Code
#RRGGBB
Hexa: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
[0 is minimum, f is maximum]
- Modifica ons are indicated using few review tags like <em> <ins> <del> <strong> etc.
Ex:
<!DOCTYPE html>
<html>
<head>
< tle>Font</ tle>
} ul {
margin-le : -20px;
</style>
</head>
<body>
<table width="1000">
<tr valign="top">
<td>
<div>
<img src="../Images/mobile.PNG">
</div>
</td>
<td>
<div>
<div>
<br>
</font>
<br>
<ul>
</ul>
</font>
</div>
</div>
</td>
<td>
<div>
<b>
₹ 14,999
</b>
</font>
<br>
<strike>₹ 17,000</strike>
</font>
16% Off
</font>
<br>
</div>
</td>
</tr>
</table>
</body>
</html>
Images in HTML
- Whenever you are configuring images, browser verifies its “MIME” type.
- You have to use only supported image types. - HTML standard Image types
Abbrevia o n File Format MIME Type File
Extensio n
- XML format images can be available offline. - Cross pla orm [Every Device]
A developer must know the type of image suitable for situa on.
Image Type Purpose
PNG
- High resolu on
- High defini on
- Occupy more space in memory
JPG
- Compressed Image format - Occupies less space.
- High resolu on
- High defini on
GIF
- Low resolu on
- Low defini on
WebP
- It embeds image into page.
- If you are using images for adver sements then you have to configure the size also as per standards
Leaderboard and height] 728 x 90 [pixels in width
- It is a void element.
alt It defines the alterna ve text to display when image is unable to load.
Width & height It specifies the width and height in pixels or in percentage.
tle It specifies the screen p to display for image when mouse is over the image.
Ex:
<!DOCTYPE html>
<html>
<head>
<body>
<img hspace="20" vspace="20" tle="Copyright of Amazon" alt="Please Wait.. Enable Images on Browser"
src="../Images/nike.jpg" align="le " border="10" width="200" height="200">
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.
</p>
</body>
</html>
A ribute Descrip on
crossorigin It specifies the accessibility of resources from cross-origin. [CORS
– Cross Origin Resource Sharing]
decoding It specifies how to load the image along with other content in page.
Ex:
<!DOCTYPE html>
<html>
<head>
< tle>Images in HTML</ tle>
<style> .card { width: 250px; padding:
10px; border:2px solid darkcyan; border-radius:
10px;
margin:30px;
}
.card-header {
text-align: center;
background-color:lightgoldenrodyellow;
font-size: 26px;
padding:3px;
}
.card-footer {
text-align: center;
background-color:lightgoldenrodyellow;
padding: 3px;
}
.card-img {
border:2px solid darkcyan;
border-radius: 100px;
}
.card-body { text-align: center;
}
.card-deck {
display: flex;
}
</style>
</head>
<body>
<div class="card-deck">
<div class="card">
<div class="card-body">
<img class="card-img" src="../Images/shoe.jpg" width="200"
height="200"> </div>
<div class="card-header">
<h3>Nike Casuals</h3>
</div>
<div class="card-footer">
<p>₹ 6700.66</p>
<p>more..</p>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Lee Boot</h3>
</div>
<div class="card-body"> <img class="card-img"
src="../Images/shoe1.jpg" width="200"
height="200"> </div>
<div class="card-footer">
<p>₹ 7000.66</p>
<p>more..</p>
</div>
</div>
<div class="card">
<div class="card-header">
<h3>Shirt</h3>
</div>
<div class="card-footer">
<p>₹ 4000.66</p>
<p>more..</p>
</div>
<div class="card-body"> <img class="card-img"
src="../Images/shirt.jpg" width="200"
height="200"> </div>
</div>
<div class="card">
<div class="card-header">
<h3>Jeans</h3>
</div>
<div class="card-body">
</div>
</body> </html>
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<div class="card-deck">
<div class="card">
<div>
<img class="card-img"
src="../Images/wild.jpg" width="100%" height="250">
</div>
<div class="card-body">
<h3>Wild Life</h3>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i)
you and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you
and Microso Corpora on (or, based on where you live or, if a business, where your principal place of business
is located, one of its affiliates) if you acquired the so ware from a retailer.
Microso is the device manufacturer for devices produced by Microso or one of its </p>
</div>
</div>
<div class="card">
<div>
<img class="card-img"
src="../Images/wild.jpg" width="100%" height="250">
</div>
<div class="card-body">
<h3>Wild Life</h3>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i)
you and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you
and Microso Corpora on (or, based on where you live or, if a business, where your principal place of business
is located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its </p>
</div>
</div>
</div>
</body>
</html> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<div class="card-deck">
<div class="card">
<div>
<img class="card-img"
src="../Images/wild.jpg" width="100%" height="250">
</div>
<div class="card-body">
<h3>Wild Life</h3>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i)
you and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you
and Microso Corpora on (or, based on where you live or, if a business, where your principal place of business
is located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its </p>
</div>
</div>
<div class="card">
<div>
<img class="card-img"
src="../Images/wild.jpg" width="100%" height="250">
</div>
<div class="card-body">
<h3>Wild Life</h3>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i)
you and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you
and Microso Corpora on (or, based on where you live or, if a business, where your principal place of business
is located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its </p>
</div>
</div>
</div>
</body>
</html>
Hyperlinks in HTML
- Link is clickable text, picture or graphic that navigates the user to any specified loca on when clicked.
Note: According the Web Designing standards every website must have a proper naviga on mechanism. User
must able to reach to any topic just with one click.
- Hyperlinks in Website are classified into 2 types o Intra document links o Inter document links
- It is a hyperlink that handles naviga on from one loca on to another within the page.
- In order to navigate to any loca on within page, you have to define unique reference ID for the target
element.
Ex:
<h2 id=”electronics”> </h2>
<div id=”footwear”> </div>
<img id=”pic”>
- The anchor element uses “href” a ribute that specifies the target loca on.
o a:ac ve { }
- text-decora on:none
Ex:
<!DOCTYPE html>
<html>
<head>
} ul { list-style: none;
} li {
width: 100px; margin-top: 20px; border:2px
solid darkcyan; padding: 5px; border-radius: 5px;
background-color: darkcyan; color:white;
} a{ color:white; text-
decora on: none;
}
</style>
</head>
<body>
<div class="container">
<div class="navbar">
<ul>
</ul>
</div>
<div class="content">
<h2 id="electronics">Electronics</h2>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<h2 id="footwear">Footwear</h2>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer.
Microso is the device manufacturer for devices produced by Microso or one of its affiliates, and Microso is
the retailer if you acquired the so ware directly from Microso . Note that if you are a volume license
customer, use of this so ware is subject to your volume license agreement rather than this agreement.</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<h2 id="fashion">Fashion</h2>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<div id="wild">
</div>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
<p>Depending on how you obtained the Windows so ware, this is a license agreement between (i) you
and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii) you and
Microso Corpora on (or, based on where you live or, if a business, where your principal place of business is
located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device manufacturer
for devices produced by Microso or one of its affiliates, and Microso is the retailer if you acquired the
so ware directly from Microso . Note that if you are a volume license customer, use of this so ware is subject
to your volume license agreement rather than this agreement.</p>
</div>
</div>
</body>
</html>
- Intra document links can use target selector of “css” in order to highlight the target content if it is not
scrollable.
Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<header>
<nav>
<ul>
<li><a href="#html">HTML</a></li>
<li><a href="#css">CSS</a></li>
<li><a href="#js">JavaScript</a></li>
</ul>
</nav>
</header>
<h2>HTML</h2>
</div>
<h2>CSS</h2>
</div>
<h2>JavaScript</h2>
<p>It is a language.</p>
</div>
</body>
</html>
- You can handle Scrolling of content in a page with a “S cky Posi on”.
Ex:
<!DOCTYPE html>
<html>
<header>
<style> dt {
background-color: black;
padding:10px;
color:white; font-
weight: bold; font-
size: 24px;
top:0px; posi on:
s cky;
}
</style>
</header>
<body>
<dl>
<dt>HTML</dt>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dd>Normal Elements</dd>
<dd>Void Elements</dd>
<dt>CSS</dt>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dd>Selectors</dd>
<dd>Transi ons</dd>
<dd>Responsive Design</dd>
<dt>JavaScript</dt>
<dd>Variables</dd>
<dd>Data TypeScript</dd>
<dd>Operators</dd>
<dd>Statements</dd>
<dd>Variables</dd>
<dd>Data TypeScript</dd>
<dd>Operators</dd>
<dd>Statements</dd>
<dd>Statements</dd>
<dd>Variables</dd>
<dd>Data TypeScript</dd>
<dd>Operators</dd>
<dd>Statements</dd>
<dd>Variables</dd>
<dd>Data TypeScript</dd>
<dd>Operators</dd>
<dd>Statements</dd>
</dl>
</body>
</html>
- Hyperlinks that handle naviga on to any URL or any another page in website.
- It also refers Hyperlink which can invoke email and call clients.
o URL
o Email Client o Mobile Dial applica on o HTML Page
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<ol>
<li>Contact : <a
href="mailto:[email protected]">[email protected]</a></li> <li>Call : <a
href="tel:+919876543210">+919876543210</a></li>
</ol>
</body> </html>
Note:
- Every file that you configured as target in Hyperlink can’t open in browser. Files require special plugins
to open the content and show in browser.
- If plugin is missing on not available then the linked file will be downloaded.
FAQ: How to download any file through a link without opening it in browser?
- You can define link with “target” a ribute with value “_blank” to open in a new tab.
Syntax:
Syntax:
<a
href="javascript:window.open('../Images/shoe.jpg','Nik e','width=500 height=400')"> Nike Casuals</a>
FAQ: How to open link target in the same window along with exis ng content?
- You can embed the link target into same window along with exis ng content by using “iFrame”
- Iframe allows to embed any external linked document into the page at specified loca on.
Ex:
Ex:
Frames in HTML
- HTML provides <frameset> that can split the browser window into mul ple windows.
Note: It is not embedding the content into page. It is spli ng the window into horizontal or ver cal panes. -
The document that is designed with frame can’t contain body sec on.
Syntax:
<!DOCTYPE html>
<html>
<head>
</head>
<frame></frame>
<frame></frame>
<frame></frame>
</frameset>
</html>
Syntax:
<!DOCTYPE html>
<html>
<head>
</head>
<frame></frame>
<frame src="../Pages/home.html"></frame>
<frame></frame>
</frameset>
</html> Ex:
1.Add following files into “Pages”
a. Menu.html
b.Footwer.html
c. Home.html
d.Electronics.html
e.Footwear.html
f. Fashion.html
2.Menu.html
<head>
<link rel="stylesheet" href="../fonts/css/all.css">
<style>
ul {
list-style: none;
}
li {
width: 100px; padding:10px; margin-top: 30px;
background-color: darkcyan;
color:white;
}
a{
text-decora on: none;
color:white;
} </style> </head>
<body> <ul>
<li><a href="../Pages/home.html" target="frameBody"> <span class="fa fahome"></span>
Home</a></li>
<li><a href="../Pages/electronics.html" target="frameBody"> <span class="fa
fatv"></span> Electronics</a></li> <li><a href="../Pages/footwear.html"
target="frameBody"> <span class="fa fa-shoeprints"></span> Footwear</a></li>
<li><a href="../Pages/fashion.html" target="frameBody"> <span class="fa fatshirt"></span>
Fashion</a></li>
</ul> </body>
3.Index.html
<!DOCTYPE html>
<html>
<head>
< tle>Shopping | Online</ tle>
</head>
<frameset cols="15%, 70%, 15%" noresize>
<frame src="../Pages/menu.html"></frame>
<frame name="frameBody" src="../Pages/home.html"></frame>
<frame src="../Pages/footer.html"></frame>
</frameset>
</html>
<!DOCTYPE html>
<html>
<head>
iframe { border:none;
} img { border:2px solid;
}
</style>
</head>
<body>
<div class="container">
<div>
</a>
</div>
<div>
</a>
</div>
</div>
<div class="rightPanel">
</iframe>
</div>
</div>
</body>
</html>
Tables in HTML
Element Descrip on
Ex:
<!DOCTYPE html>
<html>
<head>
< tle>Tables</ tle>
</head>
<body>
<table width="400" border="1">
<cap on>Products Table</cap on> <colgroup span="2" style="backgroundcolor:
yellow;" ></colgroup>
<thead>
<tr>
<th>Product Id</th>
<th>Name</th>
<th>Price</th>
<th>Preview</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>JBL Speaker</td>
<td> ₹ 5600.55</td>
<td>
<img src="../Images/speaker.jpg" width="50" height="50">
</td>
</tr>
<tr>
<td>2</td>
<td>Nike Casuals</td>
<td>₹ 3000.44</td>
<td>
<img src="../Images/shoe.jpg" width="50" height="50">
</td>
</tr>
</tbody>
< oot>
<tr>
<td></td>
<td>© copyright 2021</td>
<td></td>
<td></td>
</tr>
</ oot>
</table>
</body>
</html>
- Box
- Void
- Above
- Below
- Rhs
- Lhs
Syntax:
<table frame=”box”>
- All
- None
- Groups
- Rows
- Cols Syntax:
<table frame=”box” rules=”groups”>
Syntax:
<table border=”1” frame=”void”> <table border=”1” rules=”all”> border will
not be applied to table.
Syntax:
Alignments
align It aligns the content horizontally le , center, right or jus fy.
Syntax:
<table align=”center”>
<tbody align=”center”>
<tr align=”center”>
<td align=”center”>
Syntax:
Syntax:
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<thead>
<tr>
</tr>
<tr>
<th colspan="2">Name</th>
<th colspan="3">Address</th>
</tr>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>City</th>
<th>State</th>
<th>Postal Code</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
< oot>
<tr>
</tr>
<tr height="50">
</tr>
</ oot>
</table>
</body>
</html>
Syntax:
<table bgcolor=”red”>
<tr bgcolor=”red”>
Summary Tags
- table
- thead - tbody
- oot
- th
- tr
- td
- colgroup
- cap on
A ributes
- frame
- border
- rules
- width
- height
- align
- valign
- bgcolor
- background
- cellspacing
- cellpadding
- colspan
- rowspan
Ex:
<!DOCTYPE html>
<html>
<head>
< tle>Products Catalog</ tle>
</head>
<body>
<table align="center" width="100%" cellspacing="20" cellpadding="10" border="0">
<tr bgcolor="lightgreen">
<td colspan="2" align="center">
<h1>Amazon Shopping</h1>
</td>
</tr>
<tr>
<td width="200">
<img src="../Images/speaker.jpg" width="200" height="200">
</td>
<td>
<table width="100%" height="100"
border="1">
<colgroup span="1" style="backgroundcolor: yellow;"></colgroup>
<tr>
<td>Name</td>
<td>JBL Speaker</td>
</tr>
<tr>
<td>Price</td>
<td>4600.55</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="200">
<img src="../Images/shoe.jpg" width="200" height="200">
</td>
<td>
<table width="100%" height="100"
border="1">
<colgroup span="1" style="backgroundcolor: yellow;"></colgroup>
<tr>
<td>Name</td>
<td>Nike Casuals</td>
</tr>
<tr>
<td>Price</td>
<td>4600.55</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="200">
<img src="../Images/shirt.jpg" width="200"
height="200"> </td>
<td>
<table width="100%" height="100"
border="1">
<colgroup span="1" style="backgroundcolor: yellow;"></colgroup>
<tr>
<td>Name</td>
<td>Shirt</td>
</tr>
<tr>
<td>Price</td>
<td>4600.55</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="lightgreen">
<td colspan="2" align="center">
<i>© copyright 2021</i>
</td>
</tr>
</table>
</body>
</html>
Ex:
<!DOCTYPE html>
<html>
<head>
< tle>Table Layout</ tle>
iframe { border:none;
} a{ color:white; text-
decora on: none;
}
</style>
</head>
<body>
<tr height="100">
<td colspan="3">
</td>
</tr>
<tr height="400">
<td width="200">
<ol>
<li>
</li>
<li>
<a href="../Pages/electronics.html"
target="frameBody"> <span class="fa fa-tv"></span> Electronics</a>
</li>
<li>
</li>
<li>
</li>
</ol>
</td>
<td>
</td>
<td width="160">
</td>
</tr>
<tr height="50">
<table align="center">
<tr>
<td>
<ul>
<li>
</li>
<li>About Us</li>
<li>Press Release</li>
<li>Gi a smile</li>
</ul>
</td>
<td>
<ul>
<li>
<h2>Get to Know Us</h2>
</li>
<li>About Us</li>
<li>Press Release</li>
<li>Gi a smile</li>
</ul>
</td>
<td>
<ul>
<li>
</li>
<li>About Us</li>
<li>Press Release</li>
<li>Gi a smile</li>
</ul>
</td>
<td>
<ul>
<li>
</li>
<li>About Us</li>
<li>Press Release</li>
<li>Gi a smile</li>
</ul>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html> Task:
Forms in HTML
- Form provides an UI from where user can interact with our applica on.
- Form is a container with collec on of elements like bu on, textbox, checkbox, radio, list box etc.
- HTML form is created by using following elements o <form> o <input> o <select> o <op on> o
<datalist> o <textarea> o <meter> o <progress> etc.
Form Container
</form>
- A page can submit the details only when they are enclosed a form.
- You have to make sure that the form elements are present inside <form> container.
Syntax:
Name : <input type=”text” name=”Name”> // Not good
<form>
Name : <input type=”text” name=”Name”> // OK </form>
A ribute Descrip on
method It indicates the request method for form, which can be:
- GET
- POST
The default form method is GET
ac on It specifies the target where the data is submi ed. It refers to the server-
side page to submit form data.
Ex: page.jsp, page.aspx, page.php, page.asp
Syntax:
<form method=”post” ac on=”page.aspx”>
Syntax:
<form method=”post” ac on=”page.aspx” target=”_blank”>
novalidate
- HTML 5 introduced valida ons.
- Some of the valida ons provided by HTML 5 are not suitable for
our requirements. Hence we have to by-pass [Ignore] the
valida ons by using “novalidate”.
Ex:
<form novalidate>
Email:
<input type=”email” name=”Email”>
<bu on>Submit</bu on> </form>
<html>
<head>
</style>
</head>
<body>
</form>
</body>
</html>
GET vs POST
GET POST
GET method is used to fetch [Access] data from POST method is used to submit data to server.
server. - If you are designing a form to submit the client
- If you are designing a form to get data from data to server, then use POST method.
server and display in page, then use GET
method.
If submit form data on GET request it will be added Data will be in Form
into URL as Query String. Message Body
Any one can view your data. It is not appended into URL, it is not visible to users.
You can’t submit complex data, like binary data. It It can submit complex data.
allows only ASCII type.
You can submit limited data. Query string allows There is no limit for submi ng data.
2048 chars.
FAQ: Can we submit form data on GET request? A.Yes. But not recommended.
HTML <input> can use the a ribute “type” to define the type of value to accept as input. You can use
“type=text” if you want to allow string type.
HTML provides several a ributes for input element.
The a ributes suitable for text input are:
A ribute Descrip on
Id It defines a unique ID
placeholder It defines the water mark text for input element. The water mark can’t
display if there is a value defined.
autofocus It can set focus to the text box automa cally on page load. Only one
element in “Form” can be set with autofocus.
Syntax:
<input type="text" placeholder="Last
Name" autofocus>
readonly It will not allow to change value.
It will not allow to input value. If you want to display a value but should
not allow to modify the value, then you can mark it as readonly.
Syntax:
<input type="text" readonly name="txtId" value="101">
Syntax:
<input type="text" disabled name="txtId" value="101">
Disabled vs Readonly
required
- It will not allow to submit empty. - It is used for mandatory fields.
- If textbox is not defined with value, then it will not allow to submit
the form.
Syntax:
<input type="text" name="txtId" required>
minlength It ensures that the input value minimum length matches the lower bound
value.
You can restrict the length of string in textbox by using minlength and
maxlength.
Syntax:
<input name="txtName" type="text" required minlength="4"
maxlength="10">
size It is used to define the width of textbox. The default width is 20.
Syntax:
<input type="text" size="2" name="txtPin" maxlength="10">
list - It uses a data list that contains op ons to display as autocomplete
text.
pa ern
- It is used to verify the format of input value and restrict the value
to specific format.
Note: Form element can’t submit its value if not defined with “name” a ribute. Hence name is mandatory to
submit the element value.
Ex:
<!DOCTYPE html>
<html>
<head>
<style> form {
display: flex;
padding:5px;
border:2px solid darkcyan;
border-radius: 10px;
}
form > div { margin-le : 5px;
}
</style>
</head> <body>
<form>
<div>
</div>
<div>
</div>
<div>
<div>
</div>
</form>
</body>
</html>
FAQ: Can we change the color of placeholder? A.Yes. By using “CSS – Placeholder Selector” Syntax:
input::placeholder { color:red; font-
weight: bold; font-family: Arial;
}
FAQ: Can we change the effect for element in focus? A.Yes. By using CSS – Focus selector.
Syntax:
2px - horizontal
<!DOCTYPE html>
<html>
<head>
<body>
<form>
<div>
<h1 align="center">Google</h1>
</div>
<div align="center">
<datalist id="terms">
</datalist>
</div>
</form>
</body>
</html>
[Regular Expression]
Ex:
<input pa ern="colou*r" type="text" name="txtTest">
[color, colour, colouur, coloruuur etc..]
Ex:
<input pa ern="b.y" type="text" name="txtTest"> [buy, boy] Ex:
<input pa ern=".y" type="text" name="txtTest"> [by, my]
Ex:
<input pa ern="\d\d" type="text"
name="txtTest"> [any 2 digits number]
Ex:
<input pa ern="\d?\d" type="text" name="txtTest"> [one or 2 digits]
Ex:
<input pa ern="[0-9]" type="text" name="txtTest">
^ Exclude
Ex:
<input pa ern="\D\D" type="text" name="txtTest">
\w Matches alpha numeric characters with underscore.
Equivalent to [A-Za-z0-9_]
Ex:
<input pa ern="\w\w" type="text" name="txtTest">
Ex:
<input pa ern="\W" type="text"
name="txtTest">
[%$#@&]
^ Exclude specified
\s Match a single white space character. Including space, tab, form feed, line
feed, and other Unicode chars.
\n – line feed
\f – form feed
\t – horizontal tab
\v – ver cal tab
Ex:
<input pa ern="\w\s\w" type="text" name="txtTest">
le |right The “|” is used as OR. We can configure mul ple by using OR. It can match
with any of the specified.
Ex:
<input pa ern="green|red|blue" type="text" name="txtTest">
“Starts with”.
[Name can alpha numeric with lower, upper and underscore between 4 to 15 chars]
Ex: \w{4,15}
+447890-6970-69
\^\+44\d{4}-\d{4}-\d{2}$
\^\+44[0-9]{4}-[0-9]{4}-[0-9]{2}$
John_123N
(?=.*[A-Z])\w{4,15} Ex:
<input pa ern="(?=.*[A-Z])\w{4,15}" type="text" name="txtTest">
Number Input:
- Instead of max length and min length number uses “Min and Max”.
- Step: specifies the increment and decrement step value. [By default it is 1] Syntax:
Date Input:
- It is not supported on all browsers. hence we have to implement using jQuery. o date
o date me-local o month o
week
Syntax:
- You can also use “type=date me-local” which allows both date and me input.
- You can also use “type=month” for month input. - You can use “type= me” for me input.
Range Input:
- Slide value can be submi ed but can’t display on page in every browser.
Password Input:
URL Input:
- If you want the user to input website address [URL] and restrict to URL format the you can define
“type=url” Syntax:
Email Input:
Color Input:
- It allows to select a color for color panel. - The color code/name is submi ed. Syntax:
File Input:
- It allows the client to browse and select any file from computer to upload into server.
- However it is just a control for selec ng file, upload logic we have to write by using
“JavaScript/JQuery”.
- You can use “mul ple” a ribute to enable selec on for mul ple files.
Syntax
- You can configure specific type dynamically using MIME type or you can also use a ribute “accept” for
filtering the file type.
Syntax:
Radio Bu ons:
- To uncheck the radio bu on, you have to reload the page or configure “Mutex”
- “Mutex” is a mul -threading mechanism that loads all tasks into memory but allow only one task in
process.
- To configure mutex all radios must run on same thread, which you can define by using “common
name”.
- By default, radio submits “ON” as value. - You can define a value to submit.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<div>
<label>Upload Photo</label>
<div>
</div>
</div>
</form>
</body> </html>
CheckBox
- You can use checkbox for selec ng one or mul ple op ons from a group of choices.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<div>
<label>Select Courses</label>
<div>
</div>
</div>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
.terms+span { color:red;
}
.terms:checked+span { color:green;
}
</style>
</head>
<body>
<form>
<div>
<label>Terms of Service</label>
<div>
<div class="container">
<p>Depending on how you obtained the Windows so ware, this is a license agreement between
(i) you and the device manufacturer or so ware installer that distributes the so ware with your device; or (ii)
you and Microso Corpora on (or, based on where you live or, if a business, where your principal place of
business is located, one of its affiliates) if you acquired the so ware from a retailer. Microso is the device
manufacturer for devices produced by Microso or one of its affiliates, and Microso is the retailer if you
acquired the so ware directly from Microso . Note that if you are a volume license customer, use of this
so ware is subject to your volume license agreement rather than this agreement.</p>
</div>
<div>
</div>
</div>
</div>
</form>
</body>
</html>
- HTML is not provided with checkbox list control, you have to design with CSS overflow technique.
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<h2>Select Courses</h2>
<div class="container">
<ul>
</ul>
</div>
</body> </html>
Dropdown list:
- Every <op on> comprises of following proper es o value o text o selected o disabled
<html>
<head>
</head>
<body>
<h3>Select a Category</h3>
<form>
<select name="lstCategories">
</form>
</body> </html>
Ex: Op on Group
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h3>Select a Product</h3>
<form>
<select name="lstProducts">
</optgroup>
<optgroup label="Footwear">
</optgroup>
</select>
</form>
</body> </html>
ListBox
</select>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h3>Select a Product</h3>
<form>
</optgroup>
<optgroup label="Footwear">
</optgroup>
</select>
</form>
</body>
</html>
Textarea
o Rows
o Cols Syntax:
<textarea rows=”4” cols=”40>
</textarea> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<dl>
<dt>User Name</dt>
<dd><input type="text"></dd>
<dt>Address</dt>
<dd>
</textarea>
</dd>
<dt>Comments</dt>
<dd>
</textarea>
</dd>
</dl>
</body>
</html>
Meter Element
- It is used to display the grade meter.
o max
o value o low o high
Syntax:
<meter min=”” max=”” value=”” low=”” high=”” id=”” class=”” name=””> Ex:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<fieldset>
<legend>Meter</legend>
<dl>
<dt>Normal Style</dt>
<dd>
<meter></meter>
</dd>
<dt>Meter 40%</dt>
<dd>
</meter>
</dd>
<dt>Meter 100%</dt>
<dd>
</dd>
<dt>Meter Poor</dt>
<dd>
</meter>
</dd>
<dt>Meter Weak</dt>
<dd>
</dd>
</dl>
</fieldset>
</body>
</html>
Progress Element:
- The task includes ac ons like o Copying o Downloading o Uploading o Connec ng etc.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<dl>
<dt>Preparing for Download</dt>
<dd>
<progress></progress>
</dd>
<dt>80% Downloaded</dt>
<dd>
</dd>
<dt>Download Completed</dt>
<dd>
</dd>
</dl>
</body>
</html>
- It is a container element into which applica on can inject the result of a calcula on or
the outcome of user input.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form
oninput="total.value=qty.value*price.value">
<dl>
<dt>Name</dt>
<dd><input type="text"></dd>
<dt>Quan ty</dt>
<dd>
</dd>
<dt>Price</dt>
<dd>
</dd>
<dt>Total</dt>
<dd>
</dd>
</dl>
</form>
</body>
</html>
Bu ons:
- Bu ons in HTML are classified into 2 groups o Generic Bu ons o Non-Generic Bu ons
- Generic Bu ons have pre-defined func onality o Submit: Have the ability to submit “form”.
<input type=”submit”>
<bu on type=”submit”> Text </bu on>
<bu on> Text </bu on> o Reset: Have the ability to reset the form.
<input type=”reset”>
<bu on type=”reset”> Text </bu on>
Note: HTML <bu on> Allows images and symbols. HTML <input type=”submit”> Will not allow
symbols or images.
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<dl>
<dt>Name</dt>
<dt>Price</dt>
<dt>Stock</dt>
</dl>
<bu on>
</bu on>
<bu on type="reset">
</bu on>
</form>
</body>
</html>
Ex:
</bu on>
<input type="bu on" value="Save">
Note: Generic bu on can have the default func onality only when defined in “<form>” element.
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<form>
<dl>
<dt>Name</dt>
<dd><input type="text"
name="txtName"></dd>
<dt>Price</dt>
</dl>
</form>
</body> </html>
<!DOCTYPE html>
<html>
<head>
< tle>Amazon Login</ tle>
</style>
</head>
<body>
<div align="center">
</div>
<div class="container">
<div class="form-group">
<div>
</div>
</div>
<div class="form-group">
</div>
<div class="form-group">
<p>By con nuing, you agree to Amazon's <a href="#">Condi ons of Use</a> and Privacy No ce.</p>
</div>
<div class="form-group">
<details>
<summary><a href="#">Need
Help?</a></summary>
</details>
</div>
</div>
</body>
</html>
- HTML provides various elements for presen ng anima ons, audio and video in page.
Marquee:
Syntax:
<marquee scrollamount="15">
Flash.. Flash.. 70% OFF on electornics. </marquee>
Syntax:
<marquee direc on=”up”>
</marquee>
Width and Height Sets the width and height for marquee content.
Syntax:
<marquee width=”100” height=”300”> </marquee>
Syntax:
<marquee bgcolor=”yellow”>
</marquee>
Ex:
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<div>
<marquee scrolldelay="10">
</marquee>
<marquee scrolldelay="25">
</marquee>
<marquee scrolldelay="50">
</marquee>
<marquee scrolldelay="100">
</marquee>
<marquee scrolldelay="300">
</marquee>
</div>
<div>
<div>
</div>
<div>
<div>
</div>
<div>
</div>
<div>
</div>
</marquee>
</div>
</body>
</html>
- HTML can use “<embed>” element to embed any mul media content into page.
- HTML 5 introduces <video> and <audio> elements for embedding mul media.
Video Element:
- HTML Video Element <video> embeds a media player into web page.
- You can embed “audio” content with <video> tag. But recommended to use <audio> tag for audio
content, as it provides be er a ributes for audio.
A ribute Descrip on
controls It is used to define controls for media player. Controls can be like
seekbar, and play/resume etc.
crossorign It indicates whether to use CORS.
Loop It uses a boolean value, which allows to loop the video con nuously.
Syntax:
<video muted src=”” poster=””>
Message – Is displayed when browser is unable to use video element.
</video>
Note: You can also use <source> tag for configuring video source. This technique is used to embed mul ple
videos.
Syntax:
<video a ributes>
</video>
Ex:
<!DOCTYPE html>
<html>
<head>
<body>
<h2>Video Element</h2>
</video>
</body> </html>
Ex:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Video Element</h2>
</video>
<h2>Video Embed</h2>
</body>
</html>
Syntax:
<audio controls>
<source src=”music.mp3”>
</audio>