SlideShare une entreprise Scribd logo
1  sur  30
CSS
Box Sizing
◦ The CSS box-sizing property allows us to include the padding and border in an element's total
width and height.
◦ Without the CSS box-sizing Property
◦ By default, the width and height of an element is calculated like this:
◦ width + padding + border = actual width of an element
height + padding + border = actual height of an element
◦ This means: When you set the width/height of an element, the element often appears bigger than
you have set (because the element's border and padding are added to the element's specified
width/height).
◦ With the CSS box-sizing Property
◦ The box-sizing property allows us to include the padding and border in an element's total width and
height.
◦ If you set box-sizing: border-box; on an element, padding and border are included in the width and
height
CSS Layout - float and clear
◦ The CSS float property specifies how an element should float.
◦ The CSS clear property specifies what elements can float beside the cleared element and on
which side.
float Property
◦ The float property is used for positioning and formatting content e.g. let an image float left to the
text in a container.
◦ The float property can have one of the following values:
◦ left - The element floats to the left of its container
◦ right - The element floats to the right of its container
◦ none - The element does not float (will be displayed just where it occurs in the text). This is default
◦ inherit - The element inherits the float value of its parent
◦ In its simplest use, the float property can be used to wrap text around images.
clear Property
◦ When we use the float property, and we want the next element below (not on right or left), we will
have to use the clear property.
◦ The clear property specifies what should happen with the element that is next to a floating element.
◦ The clear property can have one of the following values:
◦ none - The element is not pushed below left or right floated elements. This is default
◦ left - The element is pushed below left floated elements
◦ right - The element is pushed below right floated elements
◦ both - The element is pushed below both left and right floated elements
◦ inherit - The element inherits the clear value from its parent
CSS Units
◦ CSS Units
◦ CSS has several different units for expressing a length.
◦ Many CSS properties take "length" values, such as width, margin, padding, font-size, etc.
◦ Length is a number followed by a length unit, such as 10px, 2em, etc.
◦ Absolute
◦ Relative
Absolute Lengths
◦ The absolute length units are fixed and a length expressed in any of
these will appear as exactly that size.
◦ Absolute length units are not recommended for use on screen, because
screen sizes vary so much. However, they can be used if the output
medium is known, such as for print layout.
cm centimeters
mm millimeters
in inches (1in = 96px = 2.54cm)
px * pixels (1px = 1/96th of 1in)
pt points (1pt = 1/72 of 1in)
pc picas (1pc = 12 pt)
Relative Lengths
Relative length units specify a length relative to another length property. Relative length
units scale better between different rendering medium.
Unit Description
em Relative to the font-size of the element (2em means 2
times the size of the current font)
rem Relative to font-size of the root element
vw Relative to 1% of the width of the viewport*
vh Relative to 1% of the height of the viewport*
% Relative to the parent element
CSS box-shadow Property
◦ The box-shadow property attaches one or more shadows to an element.
◦ Syntax: box-shadow: 10px 10px grey;
CSS text-shadow Property
◦ The text-shadow property adds shadow to text.
◦ This property accepts a comma-separated list of shadows to be applied to the text.
◦ Syntax: text-shadow: 2px 2px #ff0000;
CSS Selectors
◦ CSS element Selector
◦ CSS id Selector
◦ CSS class Selector
◦ CSS Universal Selector
◦ CSS Grouping Selector
CSS clip Property
◦ The clip property lets you specify a rectangle to clip an absolutely positioned element. The
rectangle is specified as four coordinates, all from the top-left corner of the element to be
clipped.
◦ The clip property does not work if "overflow:visible".
◦ Syntax: clip: rect(0px,60px,200px,0px);
CSS clip-path Property
◦ The clip-path property lets you clip an element to a basic shape or to an SVG source.
CSS Grid Layout Module
The CSS Grid Layout Module offers a grid-based layout system, with rows and columns,
making it easier to design web pages without having to use floats and positioning.
Grid-area property
Grid Elements
◦ A grid layout consists of a parent element, with one or more child elements
Display Property
◦ An HTML element becomes a grid container when its display property is set to grid or inline-
grid.
◦ grid-template-areas
◦ grid-template-columns Property
◦ grid-template-row Property
◦ justify-content
◦ align-content
Responsive Web Design
◦ Responsive web design makes your web page look good on all devices.
◦ Responsive web design uses only HTML and CSS.
◦ Responsive web design is not a program or a JavaScript
The Viewport
◦ The viewport is the user's visible area of a web page.
◦ The viewport varies with the device, and will be smaller on a mobile phone than on a computer
screen.
◦ Setting The Viewport
◦ <meta name="viewport" content="width=device-width, initial-scale=1.0">
◦ This gives the browser instructions on how to control the page's dimensions and scaling.
◦ The width=device-width part sets the width of the page to follow the screen-width of the device
(which will vary depending on the device).
◦ The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.
◦
Media Queries
◦ Media query is a CSS technique introduced in CSS3.
◦ It uses the @media rule to include a block of CSS properties only if a certain condition is true.
◦ If the browser window is 600px or smaller, the background color will be lightblue:
◦ @media only screen and (max-width: 600px) {
body {
background-color: lightblue;
}
}
◦ Always Design for Mobile First
◦ Mobile First means designing for mobile before designing for desktop or any other device (This
will make the page display faster on smaller devices).
Example
Break Points
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {...}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {...}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {...}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}
Orientation: Portrait / Landscape
◦ Media queries can also be used to change layout of a page depending on the orientation of the
browser.
◦ @media only screen and (orientation: landscape) {
body {
background-color: lightblue;
}
}
Hide Elements With Media Queries
◦ Another common use of media queries, is to hide elements on different screen sizes:
◦ /* If the screen size is 600px wide or less, hide the element */
@media only screen and (max-width: 600px) {
div.example {
display: none;
}
}
Button Styling
◦ Basic Button Styling
◦ Button Colors
◦ Button Sizes
◦ Rounded Buttons
◦ Colored Button Borders
◦ Hoverable Buttons
◦ Shadow Buttons
◦ Disabled Buttons
◦ Animated Buttons
Styling Tables
◦ Table Borders
◦ Full-Width Table
◦ Collapse Table Borders
◦ Table Width and Height
◦ Table Alignment
◦ Table Padding
◦ Horizontal Dividers
◦ Hoverable Table
◦ Striped Tables
◦ Table Color
CSS transform Property
◦ Rotate
◦ Skew
◦ Scale
• translate()
• rotate()
• scaleX()
• scaleY()
• scale()
• skewX()
• skewY()
• skew()
CSS tranisition property
CSS transitions allows you to change property values
smoothly, over a given duration.
◦ transition
◦ transition-delay => Delay the Transition Effect
◦ transition-duration
◦ transition-property
◦ transition-timing-function => Specify the Speed Curve of the Transition

Contenu connexe

Similaire à CSS.pptx

responsive web design 1_oct_2013
responsive web design  1_oct_2013 responsive web design  1_oct_2013
responsive web design 1_oct_2013 Suresh B
 
responsive web design
responsive web designresponsive web design
responsive web designSuresh B
 
Going Responsive with WordPress
Going Responsive with WordPressGoing Responsive with WordPress
Going Responsive with WordPressJames Cryer
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJustin Avery
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)Rajat Pratap Singh
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopbetabeers
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresAndreas Bovens
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.GaziAhsan
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layoutKrazy Koder
 
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Patrick Lauke
 
Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Patrick Lauke
 

Similaire à CSS.pptx (20)

responsive web design 1_oct_2013
responsive web design  1_oct_2013 responsive web design  1_oct_2013
responsive web design 1_oct_2013
 
Rwd ppt
Rwd pptRwd ppt
Rwd ppt
 
responsive web design
responsive web designresponsive web design
responsive web design
 
CSS
CSSCSS
CSS
 
Going Responsive with WordPress
Going Responsive with WordPressGoing Responsive with WordPress
Going Responsive with WordPress
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
CSS3 PPT.pptx
CSS3 PPT.pptxCSS3 PPT.pptx
CSS3 PPT.pptx
 
The specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktopThe specs behind the sex, mobile-friendly layout beyond the desktop
The specs behind the sex, mobile-friendly layout beyond the desktop
 
Intro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS featuresIntro to @viewport & other new Responsive Web Design CSS features
Intro to @viewport & other new Responsive Web Design CSS features
 
Html5
Html5Html5
Html5
 
Html5
Html5Html5
Html5
 
Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.Responsive Web Design tips and tricks.
Responsive Web Design tips and tricks.
 
Rwd slidedeck
Rwd slidedeckRwd slidedeck
Rwd slidedeck
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
Css 3 session1
Css 3 session1Css 3 session1
Css 3 session1
 
HTML and CSS part 3
HTML and CSS part 3HTML and CSS part 3
HTML and CSS part 3
 
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
Adapt and respond - mobile-friendly layouts beyond the desktop - standards>ne...
 
Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011Adaptive Layouts - standards>next London 28.05.2011
Adaptive Layouts - standards>next London 28.05.2011
 

Dernier

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Dernier (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

CSS.pptx

  • 1. CSS
  • 2. Box Sizing ◦ The CSS box-sizing property allows us to include the padding and border in an element's total width and height.
  • 3. ◦ Without the CSS box-sizing Property ◦ By default, the width and height of an element is calculated like this: ◦ width + padding + border = actual width of an element height + padding + border = actual height of an element ◦ This means: When you set the width/height of an element, the element often appears bigger than you have set (because the element's border and padding are added to the element's specified width/height).
  • 4.
  • 5. ◦ With the CSS box-sizing Property ◦ The box-sizing property allows us to include the padding and border in an element's total width and height. ◦ If you set box-sizing: border-box; on an element, padding and border are included in the width and height
  • 6. CSS Layout - float and clear ◦ The CSS float property specifies how an element should float. ◦ The CSS clear property specifies what elements can float beside the cleared element and on which side.
  • 7. float Property ◦ The float property is used for positioning and formatting content e.g. let an image float left to the text in a container. ◦ The float property can have one of the following values: ◦ left - The element floats to the left of its container ◦ right - The element floats to the right of its container ◦ none - The element does not float (will be displayed just where it occurs in the text). This is default ◦ inherit - The element inherits the float value of its parent ◦ In its simplest use, the float property can be used to wrap text around images.
  • 8. clear Property ◦ When we use the float property, and we want the next element below (not on right or left), we will have to use the clear property. ◦ The clear property specifies what should happen with the element that is next to a floating element. ◦ The clear property can have one of the following values: ◦ none - The element is not pushed below left or right floated elements. This is default ◦ left - The element is pushed below left floated elements ◦ right - The element is pushed below right floated elements ◦ both - The element is pushed below both left and right floated elements ◦ inherit - The element inherits the clear value from its parent
  • 9. CSS Units ◦ CSS Units ◦ CSS has several different units for expressing a length. ◦ Many CSS properties take "length" values, such as width, margin, padding, font-size, etc. ◦ Length is a number followed by a length unit, such as 10px, 2em, etc. ◦ Absolute ◦ Relative
  • 10. Absolute Lengths ◦ The absolute length units are fixed and a length expressed in any of these will appear as exactly that size. ◦ Absolute length units are not recommended for use on screen, because screen sizes vary so much. However, they can be used if the output medium is known, such as for print layout. cm centimeters mm millimeters in inches (1in = 96px = 2.54cm) px * pixels (1px = 1/96th of 1in) pt points (1pt = 1/72 of 1in) pc picas (1pc = 12 pt)
  • 11. Relative Lengths Relative length units specify a length relative to another length property. Relative length units scale better between different rendering medium. Unit Description em Relative to the font-size of the element (2em means 2 times the size of the current font) rem Relative to font-size of the root element vw Relative to 1% of the width of the viewport* vh Relative to 1% of the height of the viewport* % Relative to the parent element
  • 12. CSS box-shadow Property ◦ The box-shadow property attaches one or more shadows to an element. ◦ Syntax: box-shadow: 10px 10px grey;
  • 13. CSS text-shadow Property ◦ The text-shadow property adds shadow to text. ◦ This property accepts a comma-separated list of shadows to be applied to the text. ◦ Syntax: text-shadow: 2px 2px #ff0000;
  • 14. CSS Selectors ◦ CSS element Selector ◦ CSS id Selector ◦ CSS class Selector ◦ CSS Universal Selector ◦ CSS Grouping Selector
  • 15. CSS clip Property ◦ The clip property lets you specify a rectangle to clip an absolutely positioned element. The rectangle is specified as four coordinates, all from the top-left corner of the element to be clipped. ◦ The clip property does not work if "overflow:visible". ◦ Syntax: clip: rect(0px,60px,200px,0px);
  • 16. CSS clip-path Property ◦ The clip-path property lets you clip an element to a basic shape or to an SVG source.
  • 17. CSS Grid Layout Module The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, making it easier to design web pages without having to use floats and positioning. Grid-area property
  • 18. Grid Elements ◦ A grid layout consists of a parent element, with one or more child elements
  • 19. Display Property ◦ An HTML element becomes a grid container when its display property is set to grid or inline- grid. ◦ grid-template-areas ◦ grid-template-columns Property ◦ grid-template-row Property ◦ justify-content ◦ align-content
  • 20. Responsive Web Design ◦ Responsive web design makes your web page look good on all devices. ◦ Responsive web design uses only HTML and CSS. ◦ Responsive web design is not a program or a JavaScript
  • 21. The Viewport ◦ The viewport is the user's visible area of a web page. ◦ The viewport varies with the device, and will be smaller on a mobile phone than on a computer screen. ◦ Setting The Viewport ◦ <meta name="viewport" content="width=device-width, initial-scale=1.0"> ◦ This gives the browser instructions on how to control the page's dimensions and scaling. ◦ The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device). ◦ The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser. ◦
  • 22. Media Queries ◦ Media query is a CSS technique introduced in CSS3. ◦ It uses the @media rule to include a block of CSS properties only if a certain condition is true. ◦ If the browser window is 600px or smaller, the background color will be lightblue: ◦ @media only screen and (max-width: 600px) { body { background-color: lightblue; } } ◦ Always Design for Mobile First ◦ Mobile First means designing for mobile before designing for desktop or any other device (This will make the page display faster on smaller devices).
  • 24. Break Points /* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px) {...} /* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px) {...} /* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px) {...} /* Large devices (laptops/desktops, 992px and up) */ @media only screen and (min-width: 992px) {...} /* Extra large devices (large laptops and desktops, 1200px and up) */ @media only screen and (min-width: 1200px) {...}
  • 25. Orientation: Portrait / Landscape ◦ Media queries can also be used to change layout of a page depending on the orientation of the browser. ◦ @media only screen and (orientation: landscape) { body { background-color: lightblue; } }
  • 26. Hide Elements With Media Queries ◦ Another common use of media queries, is to hide elements on different screen sizes: ◦ /* If the screen size is 600px wide or less, hide the element */ @media only screen and (max-width: 600px) { div.example { display: none; } }
  • 27. Button Styling ◦ Basic Button Styling ◦ Button Colors ◦ Button Sizes ◦ Rounded Buttons ◦ Colored Button Borders ◦ Hoverable Buttons ◦ Shadow Buttons ◦ Disabled Buttons ◦ Animated Buttons
  • 28. Styling Tables ◦ Table Borders ◦ Full-Width Table ◦ Collapse Table Borders ◦ Table Width and Height ◦ Table Alignment ◦ Table Padding ◦ Horizontal Dividers ◦ Hoverable Table ◦ Striped Tables ◦ Table Color
  • 29. CSS transform Property ◦ Rotate ◦ Skew ◦ Scale • translate() • rotate() • scaleX() • scaleY() • scale() • skewX() • skewY() • skew()
  • 30. CSS tranisition property CSS transitions allows you to change property values smoothly, over a given duration. ◦ transition ◦ transition-delay => Delay the Transition Effect ◦ transition-duration ◦ transition-property ◦ transition-timing-function => Specify the Speed Curve of the Transition