Professional Documents
Culture Documents
Pradhumna Biswas, Id 200311010
Pradhumna Biswas, Id 200311010
Pradhumna Biswas, Id 200311010
Chittagong
LAB REPORT - 02
Dept Of CSE
6th Semester
Submitted To Submitted By
Objective : Here, In this experiment, we will be going to design a HTML page layout
which has 7 sections and different backgrounds. Additionally, we will learn how to
use the external CSS file.
Code:
HTML:
!DOCTYPE html>
<html>
<head>
<title>Lab Report Two</title>
<link rel="stylesheet"
href="C:\Users\Hp\Documents\html\CSS\web.css">
</head>
<body>
<p class="paragraph" id="tomato">Tomato</p>
<p class="paragraph" id="orange">Orange</p>
<p class="paragraph" id="dodgerblue">DodgerBlue</p>
<p class="paragraph" id="mediumseagreen">MediumSeaGreen</p>
<p class="paragraph" id="gray">Gray</p>
<p class="paragraph" id="slateblue">SlateBlue</p>
<p class="paragraph" id="violet">Violet</p>
</body>
</html>
CSS:
body {
p.paragraph {
text-align: center;
font-size: 30px;
font-weight: 500;
padding: 22px 0 22px 0;
}
#tomato {
background-color: tomato;
}
#orange {
background-color: orange;
}
#dodgerblue {
background-color: dodgerblue;
}
#mediumseagreen {
background-color: mediumseagreen;
}
#gray {
background-color: gray;
}
#slateblue {
background-color: slateblue;
}
#violet {
background-color: violet;
}
Output:
Description:
● We have created a HTML file named as <>Web.css and a CSS file named
as #web.css
● Then we linked the external file using link tag <link rel="stylesheet"
type="text/css" href="./web.css">
● After that we have Added a <div> <div/> tag. In div we have added 7
<p><p/> tags and finnaly added class names accordingly: Tomato, Orange
DodgerBlue, MediumSeaGreen, Gray, SlateBlue, Violet.
● In external CSS ,firstly we have import a google fonts.
● Then we set the body display: flex; and the background:#ededed; and justify-
content: center;
● So,now we will set up the div and p styles.
● In the end, we will be able to set the different backgrounds for each section.