CSS
CSS
1.Inline CSS
2.Internal CSS
3.External CSS
Inline CSS
You can add inline CSS by using the ‘style’ attribute of the
HTML element. This way is mostly used when we need to apply
the style to one unique element.
EXAMPLE:
<!DOCTYPE html>
<html>
<head>
<title>INLINE STYLE</title>
</head>
<body>
<h1 style="color: red; background: black;">This is Example of
inline style</h1>
<p style="background: black; color: blue;">This is Example of
inline style</p>
</body>
</html>
Inline CSS
Output:
Internal CSS
Example:
<!DOCTYPE html>
<html>
<head>
<title>Internal Style</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>This the Example of Internal Style</h1>
<p>This the Example of Internal Style</p>
</body>
</html>
Output:
External CSS
Output:
There are many types of selectors in CSS that we can use but
the important types of selectors in CSS that everyone must
learn are these:
Universal Selector
Element Selector
Id Selector
Class Selector
Group Selector
Id Selector
Output:
<!DOCTYPE html>
<html>
<head>
<title>id selector</title><style>
#box{
color: white;
</html>
background: black;
}
</style>
</head>
<body>
<h1 id="box">id Selector</h1>
</body>
Output:
Class Selector
character.
Output:
Class Selector
Example:
<!DOCTYPE html>
<html>
<head>
<title>class selector</title>
<style>
.box{
color: white;
</html>
background: black;
}
</style>
</head>
<body>
<h1 class="box">class Selector</h1>
</body>
</html>
Fonts
font-family
font-style
color
font-weight
text-decoration
font-size
letter-spacing
In CSS, we use the
Font Family
font-family property to specify the font of a
text.
The font-family property specifies the font for an element.
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier
New", monospace;
}
Font Family
</style>
</head>
<body>
<h1>CSS font-family</h1>
<p class="p1">This is a paragraph, shown in the Times New Roman
font.</p>
<p class="p2">This is a paragraph, shown in the Arial font.</p>
<p class="p3">This is a paragraph, shown in the Lucida Console
font.</p>
</body>
</html>
Font Family
Output:
Font Style
p.normal {
font-style: normal;
}
Font Style
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}
</style>
</head>
<body>
</body>
</html>
Font Style
Output:
color
The color property is used to set the color
of the text. The color is specified by:
h1 {
color: green;
}
</style>
</head>
<body>
</body>
</html>
color
Font-Weight
The font-weight property sets how thick or thin characters in text should be displayed.
font-weight: normal|bold|bolder|lighter|number|
initial|inherit;
Font-Weight
<!DOCTYPE html>
The font-weight property sets how thick or thin characters in text should be displayed.
<html>
<head>
<style>
p.normal {
font-weight: normal;
}
p.light {
font-weight: lighter;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Font-Weight
The font-weight property sets how thick or thin characters in text should be displayed.
</style>
</head>
<body>
</body>
</html>
Font-Weight
The font-weight property sets how thick or thin characters in text should be displayed.
text-decoration
The text-decoration shorthand CSS property sets the appearance of
The font-weight property sets how thick or thin characters in text should be displayed.
Value Description
text-decoration-line Sets the kind of text decoration to
use (like underline, overline, line-through)
<html>
<head>
<style>
body{
background:black;
color:white;
}
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
text-decoration
The font-weight property sets how thick or thin characters in text should be displayed.
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline overline;
}
</style>
</head>
<body>
text-decoration
The font-weight property sets how thick or thin characters in text should be displayed.
font-size
The font-weight property sets how thick or thin characters in text should be displayed.
font-size:medium|xx-small|x-small|small|large|x-large|xx-
large|smaller|larger|length|initial|inherit;
font-size
<!DOCTYPE html>
<html>
The font-weight property sets how thick or thin characters in text should be displayed.
<head>
<style>
div.a {
font-size: 15px;
}
div.b {
font-size: large;
}
div.c {
font-size: 150%;
}
</style>
</head>
<body>
<h1>The font-size Property</h1>
font-size
The font-weight property sets how thick or thin characters in text should be displayed.
</body>
</html>
font-size
The font-weight property sets how thick or thin characters in text should be displayed.
Output:
letter-spacing
The letter-spacing property increases or decreases the space between
The font-weight property sets how thick or thin characters in text should be displayed.
characters in a text.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
letter-spacing: 15px;
}
h2 {
letter-spacing: 2px;
}
h3 {
letter-spacing: -1px;
}
letter-spacing
The font-weight property sets how thick or thin characters in text should be displayed.
</head>
<body>
</body>
</html>
letter-spacing
The font-weight property sets how thick or thin characters in text should be displayed.
Output:
To shorten the code, it is possible to specify all the margin properties in one property.
Margin
The font-weight property sets how thick or thin characters in text should be displayed.
The CSS margin properties are used to create space around elements,
If the margin property has four
outside of any of any defined borders.
values:
margin-top
margin: 25px 50px 75px 100px;
margin-right
top margin is 25px
margin-bottom
right margin is 50px
margin-left
bottom margin is 75px
So, here is how it works:
Margin
The font-weight property sets how thick or thin characters in text should be displayed.
To shorten the code, it is possible to specify all the margin properties in one property.
Output:
Padding
The CSS padding properties are used to generate space around
The font-weight property sets how thick or thin characters in text should be displayed.
CSS has properties for specifying the padding for each side of an element:
padding-top
padding-right
padding-bottom
padding-left
If the padding property has four values: If the padding property has three
values:
padding: 25px 50px 75px 100px;
top padding is 25px padding: 25px 50px 75px;
right padding is 50px top padding is 25px
bottom padding is 75px right and left paddings are 50px
left padding is 100px bottom padding is 75px
Padding
If the padding property has two values:
The font-weight property sets how thick or thin characters in text should be displayed.
padding: 25px;
all four paddings are 25px
Padding
<!DOCTYPE html>
<html>
The font-weight property sets how thick or thin characters in text should be displayed.
<head>
<style>
div {
border: 1px solid black;
background-color: red;
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}
</style>
</head>
<body>
<div>This div element has a top padding of 50px, a right padding of 30px, a bottom
padding of 50px, and a left padding of 80px.</div>
</body>
</html>
Padding
The font-weight property sets how thick or thin characters in text should be displayed.
Border
The CSS border properties allow you to specify the style, width, and color of an
element's
The font-weight property border.
sets how thick or thin characters in text should be displayed.
<head>
<style>
body{
background:black;
color:white
}
p.dotted {border-style: dotted;}
p.dashed {border-style: dashed;}
p.solid {border-style: solid;}
p.double {border-style: double;}
p.groove {border-style: groove;}
p.ridge {border-style: ridge;}
p.inset {border-style: inset;}
p.outset {border-style: outset;}
p.none {border-style: none;}
p.hidden {border-style: hidden;}
</style>
</head>
<body>
Example
<h2>The border-style Property</h2>
The font-weight property sets how thick or thin characters in text should be displayed.
</body>
</html>
Example
The font-weight property sets how thick or thin characters in text should be displayed.
The border-radius property defines the radius of the element's
corners. Border-radius
Tip: This property allows you to add rounded corners to elements!
The font-weight property sets how thick or thin characters in text should be displayed.
This property can have from one to four values. Here are the rules:
<head>
<style>
#example1 {
border: 2px solid red;
padding: 10px;
border-radius: 25px;
}
#example2 {
border: 2px solid red;
padding: 10px;
border-radius: 50px 20px;
}
</style>
</head>
<body>
Border-radius
<h2>border-radius: 25px:</h2>
The font-weight property sets how thick or thin characters in text should be displayed.
<div id="example1">
<p>The border-radius property defines the radius of
the element's corners.</p>
</div>
</body>
</html>
Border-radius
The font-weight property sets how thick or thin characters in text should be displayed.
Background
The CSS background properties are used to add
The font-weight property sets how thick or thin characters in text should be displayed.
<h1>Hello World!</h1>
</body>
</html>
Background
Output:
The font-weight property sets how thick or thin characters in text should be displayed.
Background-image
The background-image property sets one or more background
The font-weight property sets how thick or thin characters in text should be displayed.
</body>
</html>
Background-image
Output:
The background-size
Background-Size
property specifies the size of the background
images.
There are four different syntaxes you can use with this property:
the keyword syntax ("auto", "cover" and "contain"), the one-value
syntax (sets the width of the image (height becomes "auto"), the
two-value syntax (first value: width of the image, second value:
height), and the multiple background syntax (separated with comma).
background-size: auto|length|cover|contain|initial|inherit;
#example2 {
border: 2px solid black;
padding: 25px;
background: url(mountain.jpg);
background-repeat: no-repeat;
background-size: 300px 100px;
}
Background-Size
<</style>
</head>
<body>
</body>
</html>
Background-Size
Output:
Display Property
<body>
<div class = "gfg">GeeksforGeeks</div>
<div class = "geeks">display: block; property</div>
<div class = "main">
<div id="geeks1">Block 1 </div>
<div id="geeks2">Block 2</div>
<div id="geeks3">Block 3</div>
</div>
</body>
</html>
Display-block
Output:
Display-Inline
}
#main1{
height: 200px;
width: 200px;
background: cyan;
display: inline;
}
#main2{
height: 200px;
Display-Inline
width: 200px;
background: green;
display: inline;
}
.gfg {
margin-left:20px;
font-size:42px;
font-weight:bold;
color:#009900;
}
.geeks {
font-size:25px;
margin-left:30px;
}
.main {
margin:50px;
}
</style>
</head>
<body>
<div class = "gfg">GeeksforGeeks</div>
<div class = "geeks">display: inline;
property</div>
Display-Inline
}
#main1{
height: 100px;
width: 200px;
background: cyan;
display: inline-block;
}
#main2{
height: 100px;
width: 150px;
background: green;
display: inline-block;
}
.gfg {
margin-left:200px; Display-Inline-block
font-size:42px;
font-weight:bold;
color:#009900;
}
.geeks {
font-size:25px;
margin-left:210px;
}
.main {
margin:50px;
}
</style>
</head>
<body>
<div class = "gfg">GeeksforGeeks</div>
<div class = "geeks">display: Inline-
block; property</div>
<div class = "main">
<div id="main"> BLOCK 1 </div>
<div id="main1"> BLOCK 2</div>
<div id="main2">BLOCK 3 </div>
</div>
</body>
</html>
Display-Inline-block
Display-none
working clear.
<!DOCTYPE html> Display-none
<html>
<head>
<title>CSS | Display property</title>
<style>
#main{
height: 100px;
width: 200px;
background: teal;
display: block;
}
#main1{
height: 100px;
width: 200px;
background: cyan;
display: none;
}
#main2{
height: 100px;
width: 200px;
background: green;
display: block;
}
.gfg {
margin-left:20px;
Display-none
font-size:42px;
font-weight:bold;
color:#009900;
}
.geeks {
font-size:25px;
margin-left:20px;
}
.main {
margin:50px;
}
</style>
</head>
<body>
<div class = "gfg">GeeksforGeeks</div>
<div class = "geeks">display: none;
property</div>
<div class = "main">
<div id="main"> BLOCK 1 </div>
<div id="main1"> BLOCK 2</div>
<div id="main2">BLOCK 3 </div>
</div>
</body>
</html>
Display-none
Output:
Display-flex
The flex CSS shorthand property is the combination of flex-
grow, flex-shrink, and flex-basis property. It is used to set
the length of flexible items. The flex property is much
responsive and mobile-friendly. It is easy to position child
elements and the main container. The margin doesn’t collapse
with the content margins. The order of any element can be
easily changed without editing the HTML section.
Syntax:
flex: flex-grow flex-shrink flex-basis|auto|initial|inherit;
Property Values:
initial.
● Two-value syntax: It must contains the following values:
○ The first value should be the number that will represent the
flex-grow.
Display-flex
basis.
● Three-value syntax: The values should be in the same order:
○ first number represents the flex-grow.
○ second number represents the flex-shrink.
○ a width with the valid value will represents the flex-basis.
Display-flex
<!DOCTYPE html>
<html>
<head>
<style>
#Geeks {
width: 300px;
height: 200px;
display: flex;
}
#Geeks div {
Display-flex
flex: 1;
.GFG1 {
background-color: green;
.GFG2 {
background-color: lightgreen;
.GFG3 {
background-color: darkgreen;
Display-flex
</style>
</head>
<body>
<div id="Geeks">
</div>
</body>
Display-flex
Output:
Display-flex
Display-flex
Display-flex
Display-flex
Display-flex
The CSS grid layout module is used to create a grid-based layout system, with the
Display-Grid
help of rows and columns it makes it easier to design any webpage without using floats
and positioning.
syntax:
.class {
display:grid;
}
Note: An HTML element becomes a grid if that element sets display: grid; in style
section or inline-grid. Below you will see both examples.
CSS Grid Layout Properties: These are the following grid-layout properties:
● column-gap: It is used to specify the amount of gap between the columns in which a
given text is divided using the column-count property.
● gap: It is used to set the spacing also caller gutter between the rows and columns.
● grid: It offers a grid-based layout system, with rows and columns, making it easier to
design web pages without floats and positioning.
● grid-area: It is used to set a grid item size and location in a grid layout.
Display-Grid
● grid-auto-columns: It is used to specify the size for the columns of implicitly
generated grid containers.
● grid-auto-flow: It specifies exactly how auto-placed items get flow into the grid.
● grid-auto-rows: It is used to specify the size for the rows of implicitly generated grid
containers.
● grid-column: It describes the number of properties that allow to design of grid
structures and control the placement of grid items using CSS.
● grid-column-end: It explains the number of columns an item will span, or on which
column-line the item will end.
● grid-column-gap: It is used to set the size of the gap between the columns in a grid
layout.
● grid-column-start: It defines for which column line item will start.
● grid-gap: It is used to sets the size of the gap between the rows and columns in a
grid layout.
Display-Grid
● grid-row: It is used to specify the size and location in a grid layout.
● grid-row-end: It is used to define the grid item’s end position within a grid row by
specifying the inline edge of its grid area.
● grid-row-gap: It is used to define the size of the gap between the grid elements.
● grid-row-start: It is used to define the grid items’ start position within the grid row by
specifying the inline start edge of its grid area.
● grid-template: It is a shorthand property for defining grid columns, rows, and areas.
● grid-template-areas: It is used to specify the area within the grid layout.
● grid-template-columns: It is used to set the number of columns and size of the
columns of the grid.
● grid-template-rows: It is used to set the number of rows and height of the rows in a
grid.
<!DOCTYPE html> Display-Grid
<html>
<head>
<style>
.grid-container {
display: grid;
background-color: gray;
padding: 5px;
Display-Grid
/* Designing all grid-items */
.grid-item {
padding: 20px;
font-size: 30px;
text-align: center;
}
Display-Grid
/* Designing h1 element */
h1 {
color: green;
text-align: center;
</style>
</head>
Display-Grid
<div class="grid-
item">3</div> class="grid-item">8</div>
<body>
<div class="grid- <div class="grid-
item">5</div>
<!-- Creating grid --> </body>
<div class="grid-
<div class="grid-container">
item">6</div>
position: static;
HTML elements are positioned static by default.
position: relative;
An element with position: relative; is positioned
relative to its normal position.
position: absolute;
An element with position: absolute; is positioned relative to the
nearest positioned ancestor (instead of positioned relative to the
viewport, like fixed).
Note: Absolute positioned elements are removed from the normal flow,
and can overlap elements.
Position
Visibility
}
h2.a {
visibility: visible;
}
h2.b {
visibility: hidden;
}
Visibility
</style>
</head>
<body>
<p>Notice that the hidden heading still takes up space on the page.</p>
</body>
</html>
Visibility
Output:
display:none vs hidden
Float
float: none|left|right|initial|inherit;
Property values:
none: This is the default value & the element does not
float.
left: Element floats on the left side of the container.
right: Element floats on the right side of the container.
initial Element will be set to its default value.
inherit: Element inherits floating property of its parent
property.
<!DOCTYPE html> Float left
<html>
<head>
Output:
<title>Float</title>
</head>
<style>
body{
background:black;
</style>
<body>
<div class="GFG" style="font-size:40px;
color:white; float:left;"> prepbytes </div>
</body>
</html>
<!DOCTYPE html> Float right
<html>
<head>
Output:
<title>Float</title>
</head>
<style>
body{
background:black;
</style>
<body>
<div class="GFG" style="font-size:40px;
color:white; float:right;"> prepbytes </div>
</body>
</html>
Float
clear
The clear property is used to specify that which side of
floating elements are not allowed to float. It sets or
returns the position of the element in relation to floating
objects. If the element can fit horizontally in the space
next to another element which is floated, it will.
Syntax:
clear: none|left|right|both|initial;
Property values:
Syntax:
z-index: auto|number|initial|inherit;
Property values:
.black-box {
position: relative;
z-index: 1;
border: 2px solid black;
height: 100px;
margin: 30px;
}
.gray-box {
position: absolute;
z-index: 3; /* gray box will be above both green and black box */
background: lightgray;
height: 60px;
width: 70%;
left: 50px;
top: 50px;
}
.green-box {
Z-index
position: absolute;
z-index: 2; /* green box will be above black box */
background: lightgreen;
width: 35%;
left: 270px;
top: -15px;
height: 100px;
}
</style>
</head>
<body>
<h1>Z-index Example</h1>
<div class="container">
<div class="black-box">Black box (z-index: 1)</div>
<div class="gray-box">Gray box (z-index: 3)</div>
<div class="green-box">Green box (z-index: 2)</div>
</div>
</body>
</html>
Z-index
Output:
Z-index
Box-Shadow
The box-shadow property in CSS is used to give a shadow-like effect to the frames of an element. The
multiple effects can be applied to the element’s frame which is separated by the comma. The box-shadow
can be described using X and Y offsets relative to the element, blur and spread radius, and color.
Syntax:
Property Value: All the properties are described well with the example below.
h-offset: It is required to set the position of the shadow horizontally. The positive value is used to set the
shadow on the right side of the box and a negative value is used to set the shadow on the left side of the
box.
v-offset: It is required to set the position of shadow value vertically. The positive value is used to set the
shadow below to the box and a negative value is used to set the shadow above the box.
blur: It is an optional attribute, the work of this attribute is to blur the shadow of the box.
#example2 {
border: 1px solid;
padding: 10px;
box-shadow: 5px 10px
#888888;
}
</style>
</head>
<body>
Box-Shadow
<h1>The box-shadow Property</h1>
<p>The box-shadow property defines the shadow of an
element:</p>
</body>
</html>
Box-Shadow
Text-Shadow
The text-shadow property in CSS is used to add shadows to the text. This property accepts a
list of shadows that are to be applied to the text, separated by the comma. The default
Syntax:
inherit;
Property values:
Text-Shadow
h-shadow: This property is required & used to specify the position of horizontal shadow. It
v-shadow: This property is required & used to specify the position of vertical shadow. It also
blur-radius: It is used to set the blur radius. Its default value is 0 & is optional.
none: It represents no shadow added to the text, this is the default value.
<head>
<style>
h1 {
</style>
</head>
<body>
</body>
Css Gradients
Syntax:
}
#grad1 {
height: 200px;
background-color: red; /* For browsers that do not support gradients */
background-image: linear-gradient(red, yellow);
}
</style>
</head>
<body>
<div id="grad1"></div>
</body>
</html>
Linear Gradients
Radial Gradients
The radial-gradient() function sets a radial gradient as the background
image.
To create a radial gradient you must define at least two color stops.
</body>
</html>
Css transform
The transform property in CSS is used to change the coordinate space of the visual formatting model. This is
Syntax:
transform: none|transform-functions|initial|inherit;
Values:
rotateX(angle): It specifies the rotation along with the X-axis corresponding to the angle of rotation.
roatateY(angle): It specifies the rotation along with the Y-axis corresponding to the angle of rotation.
roteteZ(angle): It specifies the rotation along with the Z-axis corresponding to the angle of rotation.
scale(x, y): It specifies the scale transformation along the X and Y axes.
scale3d(x, y, z): It specifies the scale transformation along the X, Y, and Z axes.
scale3d(x, y, z): It specifies the scale transformation along the X, Y, and Z axes.
skew(angle, angle): It specifies the skew transformation along the X and Y axes corresponding to the skew
angles.
skewX(angle): It specifies the skew transformation along with the X-axis corresponding to the skew angle.
skewY(angle): It specifies the skew transformation along with the Y-axis corresponding to the skew angle.
skewZ(angle): It specifies the skew transformation along with the Z-axis corresponding to the skew angle.
width: 150px;
<html> </style>
height: 80px;
<head> </head>
<h2>transform: scaleY(1.5):</h2>
background-color: yellow;
<style> <body>
<div class="c">Hello World!</div>
-ms-transform: skewY(20deg); /* IE
body{
9 */
background:black; <h1>The transform Property</h1>
</body>
transform: skewY(20deg);
color:blue;
</html>
}
} <h2>transform: rotate(20deg):</h2>
The @keyframes rule: Keyframes are the foundations with the help of which CSS
Animations works. They define the display of the animation at the respective stages
of its whole duration.
<!DOCTYPE html>
<html> Css Animation
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
}
@keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
</style>
</head>
<body>
<h1>CSS Animation</h1>
<div></div>
</body>
</html>
Css Responsive screen
Types of CSS
Inline CSS
Internal
CSS
External
CSS
Class and Id - CSS
Selectors
class vs id
• id is unique, an id can appear only once on
the page
• An element can have only one id.
font-family
font-style
color
font-weight
text-decoration
font-size
letter-spacing
Font Family
normal
bold
bolder
lighter
100 - 900
Font style
normal
italic
oblique
initial
inherit
Text Decoration
text-decoration
px vs em vs rem vs percentage vs cm
h1 {
font-size: 2.5em; /*
40px/16=2.5em */
}
h2 {
font-size: 1.875em; /*
30px/16=1.875em */
}
Margin and
Padding
Margins
Properti
es :
margin
margin-top:
margin-bottom:
margin-left:
margin-right:
margin: top right bottom
left
margin: 100px 20px 50px
75px;
margin: 100px 20px;
margin : 25px
Paddin
g
padding :
padding-top:
padding-bottom:
padding-left:
padding-right:
padding: top right bottom
left
Borders
Border
Border Style
Properti solid
Valuesdotted
es
dashe
border-width: d
border-style: groov
border-color: e
border: border-width border-style border- ridge
color inset
outset
none
hidde
n
doubl
e
Border Radius
Properti
es
border-radius
Background
Backgroun
d
background-color
background-image
background-size
background-repeat
background-position
Display &
Visibility
Displa
y
block
inline
inline-block
none
flex
grid
displa
y
block
inline
inline-block
none
Common inline Common block
elements elements
n
static
relative
absolute
fixed
sticky
Visibility
Hidden
visible
collapse
initial
inherit
Float vs clear
Float : When you want any html element to go
or to float on a particular side like left or right,
then we can use float property.
index
z-index property is given specifically to those
elements about which we want to decide that it
should come on top or bottom
bottom = negative value
top = positive value
Button
There are
Styling
three ways of creating a button:
<button>Click Here</button>
<a href=“#”>Click Here</a>
<input type=“button” value=“Click Here”>
Text Shadow
text-shadow
none
h-shadow
v-shadow
blur-radius
Color
linear-gradient :
Background-image : linear-gradient(direction,
color…)
Background-image : radial-gradient(shape at
position, direction at x%, color…)
Grid
display:gri
d //columns
grid-template-columns: 20% 50% 30%;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(3, 1fr 2fr);
//row height
grid-auto-rows: minmax(100px, auto); // flexible row height
grid-auto-rows: 100px; // fixed height of rows
// items alignment
justify-items //parent
align-items: center, start, end, stretch//parent
align-self //child element
justify-self //child element
Gradients
linear-gradient
radial-gradient
Transitions
cubic-
bezier
Transformatio
ns
Scale : value=1,2…
Skew : value=30deg
Rotate : value=30deg, 1
turn
Translate : value=45px
Animation Properties
name, duration, timing-function, delay, iteration-count, direction, fill-mode;
duration : how much time your 1 round of animation effect should take
timing function : lets you vary the speed and propagation of the animation
fill-mode : backwards/ forwards , when you want your element to stay in the same
position what it was in after animation means it should not regain its initial
position(before animation started) once the animation is completed
Animation direction property
Animation direction property takes in three major values like reverse, alternate,
alternate-reverse, their description is given below :
Ex : button:hover{
color : white
}
Design