HTML4
HTML4
HTML
Introduction
1
HTML Div Tag
Click to edit Master title style
2 2
Click
Div to
tagedit Master title style
Usage
•It is used for applying styles and layout structure <div> and
allows us to manipulate and position content through CSS.
</body>
</html>
4 4
<!DOCTYPE html>
Click to edit Master
<html>
<style> title style
div {
background-color: #FFF4A3;
}
</style>
<body>
<div>
<h2>London</h2>
<p>London is the capital city of England.</p>
<p>London has over 9 million inhabitants.</p>
</div>
<p>The yellow background is added to demonstrate the footprint of the DIV element.</p>
</body>
</html> 5 5
<!DOCTYPE html>
Click to edit Master title style
<html>
<style>
div {
width: 300px;
margin: auto;
background-color: #FFF4A3;
}
</style>
<body>
<div>
<h2>Tayabas</h2>
<p>CITY.</p>
<p>QUEZON.</p>
</div>
</body>
</html>
6 6
<!DOCTYPE html>
<html>
Click to edit Master title style
<body>
<div style="background-color:#FFF4A3;">
<h2>Tayabas</h2>
<p>City</p>
<p>Quezon</p>
</div>
<div style="background-color:#FFC0C7;">
<h2>Lucena</h2>
<p>City</p>
<p>Quezon</p>
</div>
<div style="background-color:#D9EEE1;">
<h2>Lucban</h2>
<p>City</p>
<p>Quezon</p>
</div>
7 7
</body>
Click to edit Master title style
8 8
Click to edit Master title style
9
9
Click to edit Master title style
1010
}
</style>
<div style="background-color:#FFF4A3;">
<h2>Tayabas</h2>
<p>City</p>
<p>Quezon</p>
</div>
<div style="background-color:#FFC0C7;">
<h2>Lucena</h2>
<p>City</p>
<p>Quezon</p>
</div>
<div style="background-color:#D9EEE1;">
<h2>Lucban</h2>
<p>City</p>
<p>Quezon</p>
</div>
</div> 1111
ClickThe
to edit attribute
Master
class is often used to point
title style
to a class name in a style sheet. It can
also be used by a JavaScript to access and
manipulate elements with the specific
class name.
<div class="city">
<h2>Tayabas</h2>
<p>City</p>
</div>
<div class="city">
<h2>Lucena</h2>
<p>City</p>
</div>
<div class="city">
<h2>Lucban</h2>
1313
<p>Quezon</p>
Click to edit Master title style
1414
Click to edit Master title style
1515
Click to edit Master title
<!DOCTYPE html>style
<html>
<head>
<style>
.note {
font-size: 120%;
color: red;
}
</style>
</head>
<body>
</body>
</html>
1616
Click to edit Master title style
1717
<html>
<head>
<style>
Click to edit Master title style
.city {
background-color: tomato;
color: white;
padding: 10px;
}
</style>
</head>
<body>
<h2 class="city">TAYABAS</h2>
<p>CITY</p>
<h2 class="city">LUCENA</h2>
<p>CITY.</p>
<h2 class="city">LUCBAN</h2>
<p>QUEZON</p>
1818
Click to edit Master title style
1919
<html>
<head>
.main {
text-align: center;
}
</style>
</head>
<body>
<h2>Multiple Classes</h2>
</body> 2020
</html>
HTML
Click id Attribute
to edit Master title style
2121
<!DOCTYPE html>
<h2>The id Attribute</h2>
<p>Use CSS to style an element with the id "myHeader":</p>
</body>
</html>
2222
Click to edit Master title style
2323
background-color: lightblue;
color: black;
<p>CITY</p>