CSS
CSS
EXPERIMENT:01:
TIITLE: Design a web page exploring different types of CSS Application.
SOURCE CODE:
CSS_intro.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<!-- <style>
h1 {
font-size: 120px;
}
</style> -->
<link rel="stylesheet" href="CSS_intro.css" />
<title>CSS Introduction</title>
</head>
<body>
<!-- Inline CSS ->>> BAD BAD Practice -->
<!-- Internal CSS ->>> used in small amount of code -->
<!-- External CSS ->>> Best practice -->
<h1>Some Heading</h1>
</body>
</html>
CSS_intro.css:
h1 {
font-size: 100px;
color: blue;
}
OUTPUT:
EXPERIMENT:02:
TITLE: Design a web page styling with different Colour Values
SOURCE CODE:
CSS_colors.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_colors.css" />
<title>CSS Colors</title>
</head>
<body>
<section>
<h1>Welcome to CSS</h1>
<p>CSS frameworks like Bootstrap, Foundation, and Bulma
provide pre-written CSS and JavaScript components to streamline
web development</p>
</section>
</body>
</html>
CSS_colors.css:
/* Hexadecimal color value */
body {
background-color: #4b778d;
}
/* color name */
h1 {
color: white;
}
OUTPUT:
EXPERIMENT:03:
TITLE: Design a web page styled with Simple CSS Selectors
SOURCE CODE:
CSS_simple_selectors.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_simple_selectors.css" />
<title>CSS Simple Selectors</title>
</head>
<body>
<section id="course">
<h1 class="title">CSS Bootcamp</h1>
<p class="para">You will learn CSS here</p>
</section>
</body>
</html>
CSS_simple_selectors.css:
/* Element/Name Selector */ /* Arial, Helvetica, and sans-serif are all
font families used in web design */
body {
font-family: Arial, Helvetica, sans-serif;
}
.title,
.para {
margin: 10px;
padding: 15px;
}
OUTPUT:
EXPERIMENT:04:
TITLE: Design a web page demonstrating the usage of CSS backgrund
SOURCE CODE:
CSS_background.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_background.css" />
<title>CSS Backgrounds</title>
</head>
<body>
<section>
<h1>Title 1</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
Voluptatibus esse minus at perspiciatis, dolore, nulla, veniam
voluptas blanditiis eaque doloribus asperiores. Nesciunt sit delectus
magnam vitae atque eaque neque deserunt perferendis distinctio
dolorem,
</p>
</section>
<section>
<h1>Title 2</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
Voluptatibus esse minus at perspiciatis, dolore, nulla, veniam
voluptas
</p>
</section>
<section>
<h1>Title 3</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
</p>
</section>
<section>
<h1>Title 4</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
Voluptatibus esse minus at perspiciatis.
</p>
</section>
<section>
<h1>Title 5</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
Voluptatibus esse minus.
</p>
</section>
<section>
<h1>Title 6</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
Voluptatibus esse minus at perspiciatis, dolore, nulla, veniam.
</p>
</section>
<section>
<h1>Title 7</h1>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptas
repellat officia recusandae omnis, necessitatibus quas quod?
lore accusamus beatae tenetur. Placeat, hic pariatur suscipit.
</p>
</section>
<section>
<h1>title 8</h1>
<p>
Consequatur, vel quis obcaecati labore doloribus unde id ipsum vitae
laborum, vero voluptate. Voluptates consectetur dicta repellendus
hic obcaecati modi cumque vero nemo impedit in odit eius nihil?
Quibusdam, deleniti?
Accusantium minus cupiditate odio enim, tempora excepturi nemo.
</p>
</section>
</body>
</html>
CSS_background.css:
body {
color: white;
background-image: url("book.jpg");
background-size: cover;
background-position: center;
}
OUTPUT:
EXPERIMENT:05:
TITLE: Design a web page demonstrating the usage of CSS borders
SOURCE CODE:
CSS_boders.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_borders.css" />
<title>CSS Borders</title>
</head>
<body>
<section>
<h1 class="title">CSS Borders</h1>
<p class="para">In this page, you will learn how to set borders</p>
</section>
</body>
</html>
CSS_borders.css:
/* section {
border-style: solid;
border-color: black;
border-width: 2px;
padding: 10px;
} */
section {
/* border: 10px dotted green; */
border: indigo dashed 3px;
}
OUTPUT:
EXPERIMENT:06:
TITLE: Design a web page demonstrating the usage of CSS Margins
SOURCE CODE:
v
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_margins.css" />
<title>CSS Margins</title>
</head>
<body>
<section>
<h1 class="title">CSS Bootcamp</h1>
<p class="para">You will learn how CSS boders styling works</p>
</section>
</body>
</html>
CSS_margins.css:
/* section {
margin-top: 15px;
margin-right: 20px;
margin-bottom: 25px;
margin-left: 30px;
} */
section {
margin: 15px 20px 25px 30px;
}
OUTPUT:
EXPERIMENT:07:
TITLE: Design a web page demonstrating the usage of CSS Paddings
SOURCE CODE:
CSS_paddings.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_paddings.css" />
<title>CSS Paddings</title>
</head>
<body>
<section>
<h1 class="title">CSS Bootcamp</h1>
<p class="para">You will learn CSS from zero to advanced</p>
</section>
</body>
</html>
CSS_paddings.css:
/* section {
padding-top: 15px;
padding-right: 20px;
padding-bottom: 25px;
padding-left: 30px;
} */
section {
padding: 15px 20px 25px 30px;
}
OUTPUT:
EXPERIMENT:08:
TITLE: Design a web page demonstrating the usage of CSS Height & Width.
SOURCE CODE:
CSS_height_width.html:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<section>
</section>
</body>
</html>
CSS_height_width.css:
section {
height: 200px;
width: 600px;
OUTPUT:
EXPERIMENT:09:
TITLE: Design a web page demonstrating the usage of CSS Box model
SOURCE CODE:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<section>
</section>
<article>
</article>
</body>
</html>
CSS_box_model.css:
*{
/* box-sizing: content-box; */
box-sizing: border-box;
section {
height: 250px;
width: 200px;
padding: 10px;
margin: 15px;
article {
height: 250px;
width: 200px;
padding: 10px;
margin: 15px;
OUTPUT:
EXPERIMENT:10:
TITLE: Design a web page demonstrating the usage of CSS text property
SOURCE CODE:
CSS_text_props.html:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<section>
</section>
</body>
</html>
CSS_text_props.css:
h1 {
color: coral;
/* text-transform: lowercase; */
text-transform: uppercase;
text-align: center;
p{
text-align: center;
letter-spacing: 1px;
word-spacing: 5px;
OUTPUT:
EXPERIMENT:11:
TITLE: Design a web page demonstrating the usage of CSS Font properties.
SOURCE CODE:
CSS_font_props.html:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<section>
</section>
</body>
</html>
CSS_font_props.css:
section {
h1 {
color: coral;
text-transform: uppercase;
text-align: center;
font-style: italic;
font-size: 50px;
font-weight: 900;
p{
text-align: center;
letter-spacing: 2px;
word-spacing: 5px;
OUTPUT:
EXPERIMENT:12:
TITLE: Design a web page demonstrating the usage of CSS Font properties.
SOURCE CODE:
CSS_links.html:
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Links</title>
</head>
<body>
<section>
</section>
</body>
</html>
CSS_links.css:
section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
h1 {
color: coral;
text-transform: uppercase;
font-size: 50px;
p{
letter-spacing: 2px;
word-spacing: 5px;
font-weight: 700;
}
a{
text-decoration: none;
background-color: #333;
padding: 15px;
margin: 40px;
color: white;
a:hover {
background-color: coral;
box-shadow: none;
OUTPUT:
EXPERIMENT:13:
TITLE: Design a web page demonstrating the usage of CSS Combinators
selectors
SOURCE CODE:
CSS_combinators.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_combinators.css" />
<title>CSS Combinator Selectors</title>
</head>
<body>
<article id="tech">
<h1>Green Technology</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
Accusantium
nemo vel rem similique possimus! Porro, sint! Placeat, obcaecati
iusto
temporibus aspernatur accusantium sit est repellendus architecto
neque
fugit aliquid laudantium.
</p>
<div>
<p>Hey There</p>
</div>
CSS_combinators.css:
/* Descendant Selector */
#tech h1 {
font-size: 55px;
}
/* Child Selector */
article > p {
background-color: lightgreen;
padding: 15px;
}
display: inline-block;
margin: 30px;
}
OUTPUT:
EXPERIMENT:14:
TITLE: Design a web page demonstrating the usage of CSS Pseudo classes
SOURCE CODE:
CSS_pseudo_classes.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_pseudo_classes.css" />
<title>CSS Pseudo Class Selectors</title>
</head>
<body>
<article id="animal-planet">
<h1>Polar Bears</h1>
<p class="para">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex, corporis!
Reiciendis, earum doloremque libero quisquam aliquam omnis quis
quidem
tempora ducimus, commodi vel officia iusto, ex voluptatum
</p>
<div>
<p>Hey there</p>
</div>
<br />
<br />
<button>Click Me!!!</button>
</article>
</body>
</html>
CSS_pseudo_classes.css:
.main-para {
background-color: lightsalmon;
padding: 25px;
color: white;
}
OUTPUT:
EXPERIMENT:15:
TITLE: Design a web page demonstrating the usage of CSS opacity property.
SOURCE CODE:
CSS_opacity.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_opacity.css" />
<title>CSS Opacity</title>
</head>
<body>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam
cupiditate quasi repellat nobis nihil, illo, aspernatur dolorum quis
veniam consectetur accusamus? Aspernatur maiores illo odio. Labore
nemo
eos modi non?
</p>
<img src="dog.jpg" alt="Dog image" />
</body>
</html>
CSS_opacity.css:
body {
background-image: url("cars.jpg");
}
img {
height: 500px;
width: 600px;
object-fit: cover;
}
img:hover {
opacity: 0.2;
}
p{
color: #ffffff;
padding: 25px;
font-size: 30px;
background-color: #4d19191a;
}
OUTPUT:
EXPERIMENT:16:
TITLE: Design a web page demonstrating the usage of CSS Attribute
Selectors.
SOURCE CODE:
CSS_attributes.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_attributes.css" />
<title>CSS Attribute Selectors</title>
</head>
<body>
<article id="animal-planet">
<h1 title="heading-one">Primates</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ex, corporis!
Reiciendis, earum doloremque libero quisquam aliquam omnis quis
quidem
tempora ducimus, commodi vel officia iusto.
</p>
<div>
<p>Hey there</p>
</div>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ratione
labore
magni fugiat at recusandae voluptatem, corporis dolores veniam,
aperiam
quaerat quisquam, atque dolor.
</p>
</article>
<article>
<h2>Birds</h2>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Culpa,
cumque
eveniet maiores adipisci doloribus dolorum.
</p>
</article>
</body>
</html>
CSS_attributes.css:
article[id="animal-planet"] {
background-color: lightslategray;
padding: 15px;
color: white;
}
h1[title="heading-one"] {
font-size: 75px;
font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
}
a[href="#"] {
text-decoration: none;
background-color: black;
color: white;
padding: 20px;
}
OUTPUT:
EXPERIMENT:17:
TITLE: Design a web page demonstrating the usage of CSS specificity .
SOURCE CODE:
CSS_specificity.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_specificity.css" />
<title>CSS Specificity</title>
</head>
<body>
<section >
<h1 id="title">CSS Bootcamp</h1>
<p class="para">
A comprehensive guide to learning one of the most used web
languages of all time.
</p>
CSS_specificity.css:
section {
background-color: limegreen;
}
#title {
font-size: 55px;
}
h1 {
font-size: 40px;
}
.para {
color: white;
}
p{
color: blue;
}
a{
font-size: 35px;
}
h1#title {
font-size: 150px;
}
#title {
font-size: 55px;
}
OUTPUT:
EXPERIMENT:18:
TITLE: Design a web page demonstrating the usage of CSS Border Radius .
SOURCE CODE:
CSS_border_radius.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_border_radius.css" />
<title>CSS Border Radius</title>
</head>
<body>
<section></section>
<section></section>
</body>
</html>
CSS_border_radius.css:
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
align-items: center;
}
section {
height: 350px;
width: 350px;
background-color: rgb(177, 169, 53);
margin: auto;
/* border-top-left-radius: 10px;
border-top-right-radius: 30px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 30px; */
border-radius: 50%;
}
OUTPUT:
EXPERIMENT:19:
TITLE: Design a web page demonstrating the usage of CSS Box shadow.
SOURCE CODE:
CSS_box_shadow.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_box_shadow.css" />
<title>CSS Box Shadow</title>
</head>
<body>
<section>
<h1>CSS Bootcamp</h1>
<p>
A comprehensive guide to learning one of the most used web
programming
languages of all time
</p>
</section>
</body>
</html>
CSS_box_shadow.css:
section {
padding: 15px 25px;
color: #fff;
font-family: Arial, Helvetica, sans-serif;
background-color: grey;
display: inline-block;
OUTPUT:
EXPERIMENT:20:
TITLE: Design a web page demonstrating the usage of CSS Gradients
SOURCE CODE:
CSS_gradients.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_gradients.css" />
<title>CSS Gradients</title>
</head>
<body>
<section>
<h2>Chadwick Boseman</h2>
<p>
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Sequi,
possimus iusto? Sunt non exercitationem, voluptates corrupti odit,
libero voluptatibus iste adipisci distinctio.
</p>
</section>
</body>
</html>
CSS_gradients.css:
section {
padding: 25px;
color: white;
height: 500px;
/* Linear */
background-image: linear-gradient(#abdcff, #0396ff);
background-image: linear-gradient(to right, #43cbff, #9708cc);
background-image: linear-gradient(to top, #92ffc0, #002661);
background-image: linear-gradient(to bottom, #92ffc0, #002661);
background-image: linear-gradient(to left, hsl(131, 100%, 25%),
#0000f9, rgb(134, 0, 125) );
/* Radial */
/* background-image: radial-gradient(circle, #360940, #f05f57); */
/* background-image: radial-gradient(ellipse, #3b2667, #bc78ec); */
}
OUTPUT:
EXPERIMENT:21:
TITLE: Design a web page demonstrating the usage of CSS transforms
SOURCE CODE:
CSS_transforms.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_transforms.css" />
<title>CSS Transforms</title>
</head>
<body>
<!-- div.block -->
<div class="block">Here we go</div>
</body>
</html>
CSS_transforms.css:
.block {
margin: 20px;
height: 200px;
width: 200px;
padding: 10px;
background-color: teal;
/* -------------------------- */
/* transform: translateX(150px); */
/* transform: translateX(-150px); */
/* transform: translateY(150px); */
/* transform: translateY(-150px); */
/* transform: translate(400px, 250px); */
/* transform: rotate(45deg);
transform: rotate(0.125turn);
transform: rotate(0.25turn);
transform: rotate(0.5turn);
transform: rotate(0.75turn);
transform: rotate(1turn); */
/* transform: scaleX(1.2); */
/* transform: scaleY(1.2); */
transform: scale(1.2);
}
OUTPUT:
EXPERIMENT:22:
TITLE: Design a web page demonstrating the usage of CSS transitions
SOURCE CODE:
CSS_transitions.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_transitions.css" />
<title>CSS Transitions</title>
</head>
<body>
<!-- div#block -->
<div id="block"></div>
</body>
</html>
CSS_transitions.css:
body {
margin: 0;
height: 100vh;
display: grid;
place-items: center;
}
#block {
height: 250px;
width: 250px;
background-color: orange;
#block:hover {
transform: rotate(1turn);
border-radius: 50%;
background-color: black;
}
OUTPUT:
EXPERIMENT:23:
TITLE: Design a web page demonstrating the usage of CSS animations
SOURCE CODE:
CSS_animations.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_animations.css" />
<title>CSS Animations</title>
</head>
<body>
<div class="block"></div>
</body>
</html>
CSS_animations.css:
.block {
height: 100px;
width: 100px;
background-color: lawngreen;
animation-name: my-first-anime;
animation-duration: 10s;
}
@keyframes my-first-anime {
0% {
transform: translate(0);
}
25% {
transform: translate(250px, 0);
}
50% {
transform: translate(250px, 150px);
}
75% {
transform: translate(0, 150px);
}
100% {
transform: translate(0);
}
}
OUTPUT:
EXPERIMENT:24:
TITLE: Design a web page demonstrating the usage of CSS filters
SOURCE CODE:
CSS_filters.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-
scale=1.0" />
<link rel="stylesheet" href="CSS_filters.css" />
<title>CSS Filters</title>
</head>
<body>
<img src="somewhere.jpg" alt="" />
</body>
</html>
CSS_filters.css:
img {
height: 600px;
width: 700px;
object-fit: cover;
filter: blur(10px);
filter: brightness(5%);
filter: grayscale(100%);
filter: contrast(10%);
filter: opacity(0.8);
filter: saturate(150%);
filter: sepia(50%);
}
OUTPUT:
EXPERIMENT:25:
TITLE: Design a web page demonstrating the usage of CSS clip path
SOURCE CODE:
CSS_clip_path.html:
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
CSS_clip_path.css:
img {
height: 500px;
width: 750px;
object-fit: cover;
OUTPUT: