HTMLNotes
HTMLNotes
Tools/Software
1. Notepad
2. Browser/ Mozial, Chrome, Opera, Internet Explorer
Tags:
<h1>--<h6> Heading Tags
<p> Paragraph Tag
<pre> pre-formatted Tag
<u> Underline Tag
<b> Bold
<i> Italic
<br> break line/New Line
<title> Title of the Web Page
<hr> horizontal Line
<img> image tag
<details> expansion menu
<summary> label of expansion menu
<marquee>
<a>-Anchor Tag
Attribute
href= hyper link ,References
<ul> Unordered List
<ol> Ordered List
<li> List of value
<font> Changing format of text
Table Tag
<table>
<tbody> Table Body
<thead> Table Heading
<th> Table Heading
<caption> Title of Table
<tr> Table row
<td> Table column
Table Attributes
Colspan Merging columns
Rowspan Merging Row
Cellpadding space between cell and content
Cellspacing space between cell
Bgcolor,border,width,height
Form Tag:
<form>
<input>
Type: text, number, date, email, password, radio, checkbox,file
<select>
<option>
<Ledgend>
<fieldset>
<label>
<textarea rows=”5” cols=”5”></textarea>
Example 1:
<html>
<head>
<title>
Web page
</title>
</head>
<body bgcolor="yellow">
IT Team Work
</body>
</html>
<p>
N O T I E S
</p>
</body>
</html>
Types of list
1. Ordered List : It called as numbered List
2. Type in ordered list: A, a i,I
Example 9:
<html>
<head>
<title>Web Page</title>
</head>
<body>
<h2>Ordered List</h2>
<ol>
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
<li>Pear</li>
<li>Manago</li>
</ol>
<h3>ABC Type</h3>
<ol type="A">
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
<li>Pear</li>
<li>Manago</li>
</ol>
<h3>abc Type</h3>
<ol type="a">
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
<li>Pear</li>
<li>Manago</li>
</ol>
<h3>Circle Type</h3>
<ul type="circle">
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
<li>Pear</li>
<li>Manago</li>
</ul>
<h3>Sqaure Type</h3>
<ul type="square">
<li>Apple</li>
<li>Banana</li>
<li>Grapes</li>
<li>Pear</li>
<li>Manago</li>
</ul>
</body>
</html>
<html>
<body bgcolor="Aqua">
<h1 align="center"><font size="5" color="purple" face="Algerian"><u> ONLINE
ADMMISSION FOMR</u></font></h1>
<hr color="yellow">
<center>
<form method="POST" action="success.html">
<font face="Times New Roman" size="3" color="red">
<label>FRIST NAME:-</label><input type="text" name="T1" maxlength="10"
placeholder="enter name" required><br><BR>
h1 {color:red;font-size:10px}
CSS Margin
The CSS margin property defines a margin (space) outside the border.
p{
border: 2px solid powderblue;
margin: 50px; //left, top, right and bottom
}
margin-left,margin-right,margin-top,margin-bottom
Example:
<html>
<head>
<style>
p
{
border:5px outset red;
color:blue;
font-family:Airal;
text-size:20px;
margin-left:50px;
margin-top:50px;
}
</style>
</head>
<body>
<p>This is paragraph first</p>
<p>This is paragraph second</p>
</body>
</html>
a:hover {
color: red;
background-color: transparent;
text-decoration: none;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Link Style</h1>
<a href="democss.html">Visit this link</a>
</body>
</html></style>
Link Buttons
a:link, a:visited {
background-color: #f44AA6;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
}
a:hover, a:active {
background-color: red;
}
Image Floating
<p><img src="facebook.png" alt="Smiley face" style="float:right;width:50px;height:42px;">
The image will float to the right of the text.</p>
Background Cover/Repeat
<style>
body {
background-image: url('back1.jfif');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}</style>
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 16px;
text-decoration: none;
}
li a:hover {
background-color: #111111;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
The <div> and <span>Element
<div style="background-color:black;color:white;padding:20px;width:800px;height:200px;">
<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>
</div>
<html>
<head>
<style>
.color1
{
color:blue;
}
p.color2
{
color:red;
}
</style>
</head>
<body>
<h3>Class Selector</h3>
<h4 class="color1">Welcome to Book Your Hotel WebSite.</h4>
<p class="color1">Provides online booking of domestic and international hotels</p>
<p class="color2">Avail great discount and offers</p>
</body>
</html>
<html>
<head>
<style>
body
{
background-image:url('1.jpg');
background-repeat:repeat;
}
p,h1,h2
{
font-variant:small-caps;
font-family:Helvetica;
color:red;
text-align:center;
}
a:link
{
color:#ff0000; //red
}
a:visited
{
color:#00ff00; //green
}
a:hover
{
color:#0000ff; //blue
}
a:active
{
color:#ff00ff; //pink
}
ul
{
list-style-type:square;
list-style-position:inside;
}
</style>
</head>
<body>
<h1>About Us</h1>
<p>Book Your Hotel is the most trusted name in the destination management industry. We are one
of the pioneers for hotel booking. Currently we are operating out of our head office in Chicago. In
addition we have our presence across all the major cities in the US and Europ. Our primary focus is
on customer satisfaction and comfort.</p>
<p>With a manpower strength of over 400 employees spread across the US, we ensure a quick and
customized reponse to all your travel related queries.</p>
<ul>
<li>Alabama</li>
<li>Florida</li>
<li>California</li>
<li>Colorado</li>
<li>Texas</li>
<li>New York</li>
</ul>
</html>
<html>
<head>
<style>
li
{
display:inline;
list-style-type:none;
}
h2
{
visibility:hidden;
}
h3
{
position:absolute;
top:5px;
}
</style>
</head>
<body>
<h2>Book Your Hotel</h2>
<h3>Welcome to the Home page</h3>
<ul>
<li> About us</li>
<li> Rooms</li>
<li> Facilities</li>
<li> Services</li>
<li> Contact us</li>
</ul>
</body>
</html>
<html>
<head>
<style>
li
{
display:inline;
list-style-type:none;
}
h2
{
visibility:hidden;
}
h3
{
position:absolute;
top:10px;
}
img
{
float:right;
}
.auto
{
clear:both;
}
</style>
</head>
<body>
}
div:hover
{
width:400px;
height:400px;
background:blue;
}
</style>
</head>
<body>
<Div></Div>
</body>
</html>
Example 15: (Animation Effect)
<html>
<head>
<style>
div
{
width:200px;
height:200px;
background:red;
positin:relative;
-webkit-animation-name:myfirst;
-webkit-animation-duration:5s;
animation-iteration-count: infinite;
}
@-webkit-keyframes myfirst
{
0%{background:red;}
20%{background:green;}
40%{background:yellow;}
80%{background:red;}
}
</style>
</head>
<body>
<div>
</div>
</body>
<html>
body {
font-family: Arial, Helvetica, sans-serif;
}
article {
float: left;
padding: 20px;
width: 70%;
background-color: #f1f1f1;
height: 300px; /* only for demonstration, should be removed */
}
/* Clear floats after the columns */
section::after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to
each other, on small screens */
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
</style>
</head>
<body>
<header>
<h2>Cities</h2>
</header>
<section>
<nav>
<ul>
<li><a href="#">London</a></li>
<li><a href="#">Paris</a></li>
<li><a href="#">Tokyo</a></li>
</ul>
</nav>
<article>
<h1>London</h1>
<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>
</article>
</section>
<footer>
<p>Footer</p>
</footer>
</body>
</html>
Assignments: