SlideShare a Scribd company logo
Tutorial - 3
• Assignment review
• Previous session revision
• Today's agenda
• Aim : To build a simple responsive website
Today's Agenda
• Visibility and z index
• Flexbox
• em, rem, vh and vw
• media queries
• selectors
• nth child
• before and after pseudo
selectors
• box shadow & Text shadow
• variables & custom properties
• creating animation & transition
• Create Transitions
• Transform properties
• Responsive website
z-
Index
• Used for showing one element one over the
other depending upon the scenario and
requirement
• NOTE: z-Index property will only work for
⚬ position as absolute, sticky or relative
• It'll not work for the positioned element as
default one which is "static"
visibilit
y
• This property is used to show or to hide the
element on the screen
• syntax:
⚬ visibility: none
• It'll only hide the element from DOM
• Unlike display:none where DOM element is
completely removed here it doesn't happen so
Flexbo
x
• It is formed form 2 words
⚬ flexible + box = flexbox
• It is one dimensional layout method to align
items in row or column
• It's the modern way to align items according to
user requirement
Element under diplay:flex property
Major properties of flexbox
• flex-direction
⚬ row
⚬ column
⚬ row-reverse
⚬ column-reverse
• flex-wrap
⚬ wrap
⚬ wrap-reverse
⚬ no-wrap
• flex-flow
⚬ row-reverse wrap ....etc.
• justify-content
⚬ center
⚬ space-between
⚬ space-evenly
⚬ space-around
• align-items
⚬ center
⚬ flex-end
⚬ flex-start
⚬ stretch
Properties associated to flexbox
• order: <numeric>
⚬ it puts element in that particular order as given in value
⚬ higher the order later the placement of that elemnt
• flex-shrink: <numeric>
• flex-grow: <numeric>
• flex-basis:
⚬ when flex-direction is row it controls width
⚬ when flex-direction is col it controls height
• align-self:
⚬ values of it can be as:
■ flex-start OR flex-end OR center
For flexbox in details must refer
following
• https://css-tricks.com/snippets/css/a-guide-to-
flexbox/
• https://mastery.games/post/flexboxzombies2/
• https://www.youtube.com/watch?v=fYq5PXgSs
bE&ab_channel=WebDevSimplified
What is responsive
website
• Having many new devices with various
resolutions makes it difficult for web-developer
to represent there website
• Hence responsive web development comes into
picture
• It's must that your all websites or web-
application should be responsive nonwdays
Varous ways to achieve responsiveness
• Setup view port
• use max-width and min-width
• use media query
• use units like
⚬ em
⚬ rem
⚬ vh
⚬ vw
⚬ px (sometimes)
Units in CSS
• em
⚬ It is w.r.t parent element
⚬ font-size: 3em
■ It means fontsize will 3 * (parents size)
⚬ NOTE: padding: 3em
■ When padding is given with font-size then
it will be 3*font-size* (parent-size)
• rem
• Its is with respect to browser not to the
parent elemnt
NOTE: If it confuses a bit please go through the
following article:
https://webdesign.tutsplus.com/tutorials/comprehe
nsive-guide-when-to-use-em-vs-rem--cms-23984
• vh and
vw
• viewport : means the the screen in front of you
in the browser
• vh:100
⚬ means complete height of view port
• vw: 100
⚬ means complete width of view port
Media queries
• It is used for making things reactive
according screen resolutions & breakpoints
• major breakpoints in general are:
⚬ Extra small devices
■ (phones, 600px and down)
⚬ Small devices
■ (portrait tablets and large phones,
600px and up)
breakpoints
: • Medium devices
⚬ (landscape tablets, 768px and up)
• Large devices
⚬ (laptops/desktops, 992px and up)
• Extra large devices (large laptops and desktops,
1200px and up)
Media query syntax
@media only screen and (min-width: 300px) and
(max-width:500px) {
#box-2 {
display: block;
background-color: blueviolet;
}
}
Media query
(screens)
• It is the type of screen that media query should support
• Most common used are:
⚬ all
⚬ screen
⚬ speech
⚬ print
• Refer:
⚬ https://www.w3schools.com/cssref/css3_pr_mediaquery.a
sp
Selector
s
NOTE : we are only considering relative selectors
only there are all together complete selector list
which can be found on :
• https://css-tricks.com/almanac/selectors/
• https://www.w3schools.com/cssref/css_selector
s.asp
Selectors
continue...
• div li p{ color: yellow; }
⚬ meaning : style will be applied to <p> inside of
<li> inside of <div>
• div > p{ color: yellow;}
⚬ meaning : style will be applied to <p> as a
direct child of <div>
• div + p{ color: white;}
⚬ meaning: style applied to <p> which is sibling
of <div>
nth child & pseudo
selectors
• We already know element selectors as
⚬ input {
⚬ display: block;
⚬ }
• Now to target any specific element we may use that
element's any attribute:
⚬ input[type='text'] {
⚬ display: block;
⚬ }
⚬
• targeting nth child
⚬ li:nth-child(3)
■ 3rd child of li is targetted
⚬ li:nth-child(2n+0) or li:nth-child(3n+3)
■ this will apply maths like 2*n + I
• where n is a natural number
• and I is any integer
⚬ li:nth-child(odd)
■ target only children at odd position
⚬ li:nth-child(even)
■ target only children at even position
before & after pseudo
selectors
• It add any content before or after the targeted
element
• example:
⚬ https://www.w3schools.com/cssref/tryit.asp
?filename=trycss_sel_before_style
Box shadow & text
shadow
• box-shadow
⚬ it will add shadow effect to targetted
element
⚬ syntax:
■ box-shadow: offset-x offset-y blur-radius spread-radius color;
■ e.g: box-shadow: -7px -5px 10px 34px green;
⚬ use box-shadow: inset , if you want to apply shadow inside the
box elemnt
• text shadow
⚬ It will apply shadow to text elements only
⚬ Its behavior syntax is almost similar to
box-shadow
Variables & custom
properties
• Variables are used to increase reusability of any
particular property
• Mostly its used when we create any design
system for any decently big project
• It can be either be declared as
⚬ global
⚬ or
⚬ local
variables
(cont...)
• syntax:
⚬ it is declared as :
■ --primary-color: blue;
⚬ it is used as:
■ background-color: var(--primary-color);
Animations and keyframes
• To increase user interaction and mostly at
time of gamification on any website or on
browser game either animation is directly
used or many libraries use the core
animation properties
• NOTE:
⚬ Here we will cover basics of animations
Properties of
animations
• animation-name: anime1;
• animation-duration: 8s;
• animation-iteration-count: 1;
• animation-fill-mode: alternate;
• animation-timing-function: ease-in-out;
• animation-delay: 3s;
• animation-direction: reverse;
keyframe
s
• It helps to define the property of anymations
• Like it uses the property
⚬ from & to
■ signifying the what will happen when
animation starts till when it may end
■ eg: animation to be started from width
200px to width 1400px
• It can also be useful to signify the journey of
animation in percentage of time-span
Web development basics (Part-2)

More Related Content

PPT
Web development basics (Part-3)
PPT
Web development basics (Part-6)
PPT
Web development basics (Part-7)
PPT
Web development basics (Part-1)
PPT
Web development basics (Part-5)
PPTX
JavaScript operators
PPT
Web development basics (Part-4)
PPTX
Javascript 01 (js)
Web development basics (Part-3)
Web development basics (Part-6)
Web development basics (Part-7)
Web development basics (Part-1)
Web development basics (Part-5)
JavaScript operators
Web development basics (Part-4)
Javascript 01 (js)

What's hot (19)

PPTX
JavaScript Basics
PPTX
JavaScript : A trending scripting language
PDF
The Skinny on Slim
PPTX
PHP Basics
PPTX
Javascript for Wep Apps
PDF
Web application
PDF
Build a game with javascript (may 21 atlanta)
PDF
Intro to JavaScript - Thinkful LA, June 2017
PDF
Web application
PDF
Web Components - The Future is Here
KEY
The Transparent Web: Bridging the Chasm in Web Development
PDF
Shootout! template engines on the jvm
PPT
introduction to javascript
PDF
Meanstack Introduction by Kishore Chandra
PDF
Fighting Ruby code smell
PDF
Masterin Large Scale Java Script Applications
KEY
Frozen rails 2012 - Fighting Code Smells
PDF
Gourmet Service Object
JavaScript Basics
JavaScript : A trending scripting language
The Skinny on Slim
PHP Basics
Javascript for Wep Apps
Web application
Build a game with javascript (may 21 atlanta)
Intro to JavaScript - Thinkful LA, June 2017
Web application
Web Components - The Future is Here
The Transparent Web: Bridging the Chasm in Web Development
Shootout! template engines on the jvm
introduction to javascript
Meanstack Introduction by Kishore Chandra
Fighting Ruby code smell
Masterin Large Scale Java Script Applications
Frozen rails 2012 - Fighting Code Smells
Gourmet Service Object
Ad

Similar to Web development basics (Part-2) (20)

PPTX
INTRODUCTIONS OF CSS PART 2
PDF
CSS3 Refresher
PPTX
CSS3 notes
PPTX
HTML and CSS part 3
PPT
Css best practices style guide and tips
PPT
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
PPTX
Web technologies-course 04.pptx
PPTX
Krishan gaurav-sapient bootstrapsession
PPTX
PPTX
Intro to front end development Basic
PPTX
Lecture-8.pptx
PPTX
Cordova training - Day 2 Introduction to CSS 3
PPTX
web Technolotogies notes lke CSS443.pptx
PPTX
cascading style sheet powerpoint notes.pptx
PPTX
FITC - 2012-04-23 - Responsive Web Design
PDF
Flexbox, Grid and Sass
PPTX
CSS for Developers
PDF
CSS vs. JavaScript - Trust vs. Control
PPT
Tutorial0eesrtjfzjgxkgxkxxkxkgxkgxjffj3.ppt
PPTX
Responsive web design
INTRODUCTIONS OF CSS PART 2
CSS3 Refresher
CSS3 notes
HTML and CSS part 3
Css best practices style guide and tips
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Web technologies-course 04.pptx
Krishan gaurav-sapient bootstrapsession
Intro to front end development Basic
Lecture-8.pptx
Cordova training - Day 2 Introduction to CSS 3
web Technolotogies notes lke CSS443.pptx
cascading style sheet powerpoint notes.pptx
FITC - 2012-04-23 - Responsive Web Design
Flexbox, Grid and Sass
CSS for Developers
CSS vs. JavaScript - Trust vs. Control
Tutorial0eesrtjfzjgxkgxkxxkxkgxkgxjffj3.ppt
Responsive web design
Ad

Recently uploaded (20)

PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
history of c programming in notes for students .pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPT
Introduction Database Management System for Course Database
PDF
System and Network Administraation Chapter 3
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Softaken Excel to vCard Converter Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
history of c programming in notes for students .pptx
Upgrade and Innovation Strategies for SAP ERP Customers
Operating system designcfffgfgggggggvggggggggg
2025 Textile ERP Trends: SAP, Odoo & Oracle
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Introduction Database Management System for Course Database
System and Network Administraation Chapter 3
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Online Work Permit System for Fast Permit Processing
How to Choose the Right IT Partner for Your Business in Malaysia
Odoo POS Development Services by CandidRoot Solutions
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Materi_Pemrograman_Komputer-Looping.pptx
Design an Analysis of Algorithms I-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
Softaken Excel to vCard Converter Software.pdf

Web development basics (Part-2)

  • 1. Tutorial - 3 • Assignment review • Previous session revision • Today's agenda • Aim : To build a simple responsive website
  • 2. Today's Agenda • Visibility and z index • Flexbox • em, rem, vh and vw • media queries • selectors • nth child • before and after pseudo selectors • box shadow & Text shadow • variables & custom properties • creating animation & transition • Create Transitions • Transform properties • Responsive website
  • 3. z- Index • Used for showing one element one over the other depending upon the scenario and requirement • NOTE: z-Index property will only work for ⚬ position as absolute, sticky or relative • It'll not work for the positioned element as default one which is "static"
  • 4. visibilit y • This property is used to show or to hide the element on the screen • syntax: ⚬ visibility: none • It'll only hide the element from DOM • Unlike display:none where DOM element is completely removed here it doesn't happen so
  • 5. Flexbo x • It is formed form 2 words ⚬ flexible + box = flexbox • It is one dimensional layout method to align items in row or column • It's the modern way to align items according to user requirement
  • 7. Major properties of flexbox • flex-direction ⚬ row ⚬ column ⚬ row-reverse ⚬ column-reverse • flex-wrap ⚬ wrap ⚬ wrap-reverse ⚬ no-wrap • flex-flow ⚬ row-reverse wrap ....etc. • justify-content ⚬ center ⚬ space-between ⚬ space-evenly ⚬ space-around • align-items ⚬ center ⚬ flex-end ⚬ flex-start ⚬ stretch
  • 8. Properties associated to flexbox • order: <numeric> ⚬ it puts element in that particular order as given in value ⚬ higher the order later the placement of that elemnt • flex-shrink: <numeric> • flex-grow: <numeric> • flex-basis: ⚬ when flex-direction is row it controls width ⚬ when flex-direction is col it controls height • align-self: ⚬ values of it can be as: ■ flex-start OR flex-end OR center
  • 9. For flexbox in details must refer following • https://css-tricks.com/snippets/css/a-guide-to- flexbox/ • https://mastery.games/post/flexboxzombies2/ • https://www.youtube.com/watch?v=fYq5PXgSs bE&ab_channel=WebDevSimplified
  • 10. What is responsive website • Having many new devices with various resolutions makes it difficult for web-developer to represent there website • Hence responsive web development comes into picture • It's must that your all websites or web- application should be responsive nonwdays
  • 11. Varous ways to achieve responsiveness • Setup view port • use max-width and min-width • use media query • use units like ⚬ em ⚬ rem ⚬ vh ⚬ vw ⚬ px (sometimes)
  • 12. Units in CSS • em ⚬ It is w.r.t parent element ⚬ font-size: 3em ■ It means fontsize will 3 * (parents size) ⚬ NOTE: padding: 3em ■ When padding is given with font-size then it will be 3*font-size* (parent-size)
  • 13. • rem • Its is with respect to browser not to the parent elemnt NOTE: If it confuses a bit please go through the following article: https://webdesign.tutsplus.com/tutorials/comprehe nsive-guide-when-to-use-em-vs-rem--cms-23984
  • 14. • vh and vw • viewport : means the the screen in front of you in the browser • vh:100 ⚬ means complete height of view port • vw: 100 ⚬ means complete width of view port
  • 15. Media queries • It is used for making things reactive according screen resolutions & breakpoints • major breakpoints in general are: ⚬ Extra small devices ■ (phones, 600px and down) ⚬ Small devices ■ (portrait tablets and large phones, 600px and up)
  • 16. breakpoints : • Medium devices ⚬ (landscape tablets, 768px and up) • Large devices ⚬ (laptops/desktops, 992px and up) • Extra large devices (large laptops and desktops, 1200px and up)
  • 17. Media query syntax @media only screen and (min-width: 300px) and (max-width:500px) { #box-2 { display: block; background-color: blueviolet; } }
  • 18. Media query (screens) • It is the type of screen that media query should support • Most common used are: ⚬ all ⚬ screen ⚬ speech ⚬ print • Refer: ⚬ https://www.w3schools.com/cssref/css3_pr_mediaquery.a sp
  • 19. Selector s NOTE : we are only considering relative selectors only there are all together complete selector list which can be found on : • https://css-tricks.com/almanac/selectors/ • https://www.w3schools.com/cssref/css_selector s.asp
  • 20. Selectors continue... • div li p{ color: yellow; } ⚬ meaning : style will be applied to <p> inside of <li> inside of <div> • div > p{ color: yellow;} ⚬ meaning : style will be applied to <p> as a direct child of <div> • div + p{ color: white;} ⚬ meaning: style applied to <p> which is sibling of <div>
  • 21. nth child & pseudo selectors • We already know element selectors as ⚬ input { ⚬ display: block; ⚬ } • Now to target any specific element we may use that element's any attribute: ⚬ input[type='text'] { ⚬ display: block; ⚬ } ⚬
  • 22. • targeting nth child ⚬ li:nth-child(3) ■ 3rd child of li is targetted ⚬ li:nth-child(2n+0) or li:nth-child(3n+3) ■ this will apply maths like 2*n + I • where n is a natural number • and I is any integer ⚬ li:nth-child(odd) ■ target only children at odd position ⚬ li:nth-child(even) ■ target only children at even position
  • 23. before & after pseudo selectors • It add any content before or after the targeted element • example: ⚬ https://www.w3schools.com/cssref/tryit.asp ?filename=trycss_sel_before_style
  • 24. Box shadow & text shadow • box-shadow ⚬ it will add shadow effect to targetted element ⚬ syntax: ■ box-shadow: offset-x offset-y blur-radius spread-radius color; ■ e.g: box-shadow: -7px -5px 10px 34px green; ⚬ use box-shadow: inset , if you want to apply shadow inside the box elemnt
  • 25. • text shadow ⚬ It will apply shadow to text elements only ⚬ Its behavior syntax is almost similar to box-shadow
  • 26. Variables & custom properties • Variables are used to increase reusability of any particular property • Mostly its used when we create any design system for any decently big project • It can be either be declared as ⚬ global ⚬ or ⚬ local
  • 27. variables (cont...) • syntax: ⚬ it is declared as : ■ --primary-color: blue; ⚬ it is used as: ■ background-color: var(--primary-color);
  • 28. Animations and keyframes • To increase user interaction and mostly at time of gamification on any website or on browser game either animation is directly used or many libraries use the core animation properties • NOTE: ⚬ Here we will cover basics of animations
  • 29. Properties of animations • animation-name: anime1; • animation-duration: 8s; • animation-iteration-count: 1; • animation-fill-mode: alternate; • animation-timing-function: ease-in-out; • animation-delay: 3s; • animation-direction: reverse;
  • 30. keyframe s • It helps to define the property of anymations • Like it uses the property ⚬ from & to ■ signifying the what will happen when animation starts till when it may end ■ eg: animation to be started from width 200px to width 1400px • It can also be useful to signify the journey of animation in percentage of time-span