Complete CSS Course Notes
Complete CSS Course Notes
HTML
CSS
JAV ASCRIPT
What is CSS?
h1 {
color: red;
font-size: 32px;
}
• A community of web developers, designers, and browser vendors also contribute to its
evolution.
• Regular updates and new versions ensure CSS remains relevant and adaptable to
changing web design needs.
CSS1 (1996)
01
Limited properties and selectors.
CSS2 (1998)
CSS to CSS3 02
CSS 2 was released and work on CSS 3 began
selector {
Declaration
property: value;
/* More properties and values */
}
h1 { Value
color: red;
Property font-size: 32px;
}
p{
Value
color: blue;
Property font-weight: bold;
}
Declaration
Internal CSS
3 Ways 02
Styles defined within the <style> tag within the
HTML document's <head>.
External CSS
03
Styles stored in separate .css files linked to the
HTML document using the <link> element.
h1 { Value
color: red;
Property font-size: 32px;
}
<section>
<button class="btn">
Subscribe Thapa Technical
</button>
</section>
Class-Selector
.btn{
Value
color: blue;
Property font-weight: bold;
}
Declaration
<section>
<button id="btn">
Subscribe Thapa Technical
</button>
</section>
#btn{
Value
color: blue;
Property font-weight: bold;
}
Value
a:hover{
color: blue;
Property font-weight: bold;
}
Declaration
GREEN – #00 FF 00
02
0, 255, 0
CYAN
Magenta
B LUE
RGB = 0, 255, 255
RGB = 255, 0, 255
HEX = #00 FF FF
HEX = #FF 00 FF
B LUE
BACKGROUND IN CSS
01 background-color 04 background-position
02 background-image 05 background-size
03 background-repeat 06 background-attachment
UNITS IN CSS
01 Pexels (px) 04 em
03 Font Weight
03 Text Transform
Offset-Y
MARGIN
B ORDER
PADDING
RIGHT
HEIGHT
LEFT CONTENT
T
WIDTH
B OTTOM
BORDER IN CSS
Border-Style
PADDING IN CSS
MARGIN IN CSS
MARGIN
B ORDER
PADDING
RIGHT
HEIGHT
LEFT CONTENT
T
WIDTH
B OTTOM
Color-stop2
Property
Color-stop1
Property
background-image: linear-gradient
(to right, Direction
red, yellow);
Color-stops
Property
background-image: linear-gradient
(90deg, Angle
red, yellow);
Color-stops
Color-stop2
Property
Color-stop1
Property
background-image: linear-gradient
(circle, Shape
red, yellow);
Color-stops
BOX SHADOW
IN CSS
Density/Spread
Offset-Y
Offset-X Color
Blur-radius
DROP SHADOW
IN CSS
Offset-X
Blur-radius
FILTERS IN CSS
01 grayscale() 02 opacity()
03 blur() 04 contrast()
05 brightness() 06 invert()
LISTS IN CSS
01 List-style-type 03 List-style-position
02 List-style-image 04 List-style-property
ANCHOR IN CSS
COMBINATORS
IN CSS
Descendant Selector
01 02 Child Selector (>)
(Space)
DISPLAY IN CSS
03 Inline-Block Elements
01 Relative 02 Absolute
03 Static 04 Fixed
05 Sticky
.child {
position: absolute;
}
Child Div
Parent Div
.child {
position: absolute;
left: 50%
}
.child {
position: absolute;
left: 50%
top:50%
}
.child {
position: absolute;
left: 0;
bottom:0;
}
.child {
position: absolute;
right: 0;
bottom:0;
}
.child {
position: absolute;
top: 0;
left:0;
}
Z-INDEX IN
CSS
OVERFLOW
IN CSS
Overflow: V isible
01 03 Overflow: Scroll
(Default)
01 ::before 02 ::after
03 ::first-letter 04 ::first-line
05 ::selection 06 ::placeholder
PSEUDO CLASS
IN CSS
01 :hover 02 :first-child
03 :last-child 04 :nth-child(n)
05 :first-of-type 06 :last-of-type
COLUMN LAYOUT
IN CSS
01 Column-count 02 Column-gap
03 Column-rule 04 Column-fill
FLEXBOX
IN CSS
.flex-container {
display: flex;
}
.flex-container {
display: flex;
flex-direction: row;
}
MAIN-AXIS
CROSS-AXIS
CROSS-AXIS
.flex-container {
display: flex;
flex-direction: Column;
flex-direction: row;
justify-content:start
CROSS-AXIS }
MAIN-AXIS
CROSS-AXIS
GRID IN CSS
Subscribe Thapa Technical
29
TRANSITIONS
IN CSS
01 transition-property 03 transition-timing-function
02 transition-duration 04 transition-delay
01 animation-name 02 animation-duration
03 animation-timing-function 04 animation-delay
05 animation-iteration-count 06 animation-direction
Element / pseudo-
01 * (universal selector) 02
element
03 Class or pseudo-class 04 id
0.0.1.0.0 Id
0.1.0.0.0
Inline
!important
1.0.0.0.0
For each important keyword ex h1 {color: red!important}
add 1-0-0-0-0 to the weight value.
Individual Transform
07 08 CSS Nesting
Properties
MINI PROJECTS
IN CSS
CENTER A DIV
INSIDE A DIV
Subscribe Thapa Technical
🔥
HOW TO CENTER A
DIV INSIDE DIV
IN CSS
Subscribe Thapa Technical
POSITIONS – Absolute
Top:0, left:0 Top:0, right:0
.child {
position: absolute;
}
Child Div
Parent Div
.child {
position: absolute;
left: 50%
}
.child {
position: absolute;
left: 50%
top:50%
}
.child {
position: absolute;
left: 50%;
top:50%;
transform:translate(-50%)
}
.child {
position: absolute;
left: 50%;
top:50%;
transform:translate(-50%,-50%)
}
.child {
position: absolute;
left: 50%;
bottom:50%;
transform:translate(-50%,-50%)
}
.flex-container {
display: flex;
flex-direction: row;
justify-content:center;
align-items:center;
}
https://www.w3.org/community/webed/wiki/Optimizing_content_for_different_browsers:_the_RIGHT_way
FINAL PROJECTS
IN CSS
SEO
IN CSS
04 Image Optimization
TESTING
IN CSS
02 https://pagespeed.web.dev/
03 https://gtmetrix.com/
41
HOSTING
WEBSITE LIVE
https://www.netlify.com/ http://www.hostinger.com/