SlideShare uma empresa Scribd logo
1 de 11
Cascading Style Sheets 3 (CSS3)
What’s CSS?
> CSS Stands for Cascading Style Sheets.
> It describes how HTML elements are to be
displayed on screen, paper, or in other media.
> External style sheets are stores in a (.css) file.
> Checkout same page, different style sheets here,
https://www.w3schools.com/css/css_intro.asp
Why CSS?
> CSS defines styles for our website. Everything will
look weird if we don’t style our web pages.
> Imagine living in a building without its wall being
painted!
> Moreover, we all want our customers / visitors to
spend some time on the website instead of just
closing them at once. Well, to stop them and gain
their first impression as the best one, we need to
have some awesome styles for the web page!
Where would you want to go is why you want to use CSS!
CSS Syntax CSS Selectors
That’s how we style it!
30 CSS Selector you must memorize: https://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048
CSS vs CSS3
> Pseudo Classes (Limited)
[selector]:pseudo-class{
// CSS Code here
}
E.g.: :first-child
> No support for animations. Animations were added using
JavaScript & jQuery (a JavaScript library).
> Before CSS3 developers used to develop images that looked like
rounded corners.
> Not compatible with CSS3
> Much more pseudo classes
E.g.: :nth-child()
:root
:empty
> Supports text shadow
> Supports animations
> Supports border-radius & gradient
> Backward Compatible to CSS
> They load faster and time required to write them is lesser as
compared to that of CSS.
Cascading Specificity Inheritance
What do you think h1 will be colored as?
Cascading means that the order
of CSS rules matter. When two
rules apply that have equal
specificity, the latter one will be
used.
Specificity basically is a measure of the
CSS rule priority.
In simple words, it is how the browser
decides which rule applies if multiple rules
have different selectors
Here, class has greater specificity than
the HTML tag itself [Rule]
Some CSS property values set on parent
elements are inherited by their child
elements, and some aren't.
For example, if you set a color and
font-family on an element, every element
inside it will also be styled with that color
and font, unless you've applied different
color and font values directly to them.
Some properties do not inherit — for
example if you set a width of 50% on an
element, all of its descendants do not get
a width of 50% of their parent's width.
Which properties are inherited by default
and which aren't is largely down to
common sense.
Controlling CSS Inheritance - ( inherit, initial, unset, revert, all )
Takes computed value from the parent.
Sets a property to its initial value defined
on a per-property basis by the CSS
specifications..
Sets a property to its inherited value if it inherits,
or to its initial value if not.
https://jsbin.com/sayodab/1/edit?html,css,output
New additions:
> revert :
It resets the property to its inherited value if it
inherits from its parent or to the default value
established by the user agent stylesheet (or by user
styles, if any exist).
User Agent Style sheets simply refer to the default styles that
browsers apply to web pages.
> all :
Can be used to apply one of these inheritance
values to (almost) all properties at once.
https://jsbin.com/livugin/1/edit?html,css,output
# Unset vs Revert (Important)
https://jsbin.com/famagez/2/edit?html,css,output
Not same
More on Cascade
Source Order
If you have more than one
rule, which has exactly the
same weight, then the one
that comes last in the CSS
will win.
Specificity
1) Inline Style - 1000
2) Id selector - 100
3) Class selector (.class, [attributes], :pseudo-class, :hover, :focus, etc.) - 10
4) Element / Tag & Pseudo Elements (h1, :pseudo-elements, :before, :after, :first-element, etc.) - 1
5) :not, * - 0
6) !important - 10,000
Note:
1) The universal selector (*), combinators (+, >, ~, ' '), and negation pseudo-class (:not) have no effect
on specificity.
2) Inline > Internal > External
101
100
11
CSS Box Model - 1
> Normal : Inline Block
> The box will not break into new line.
> Width & height properties will not apply.
> Only horizontal paddings, margins and borders will apply and will
cause other boxes to move away from them.
> Vertical padding won’t apply.
https://jsbin.com/zexolib/2/edit?html,css,output
> E.g. <a>, <span>, <em>, <strong>, etc.
> The box will break into new line.
> Width & height properties are respected.
> Will cover at max 100% by default.
> All padding, margin and borders will cause other boxes to move
away.
> E.g. <div>, <h1>, <p>, etc.
> Not Normal : Flex
> When flex is set, the outer display turns to block but the inner
display is set to flex.
> Inline Flex
CSS Box Model - 2
Standart Box Model Alternative Box Model
> In this model, the content area of box =
(total-width of box - border / padding).
> Can be set via:
box-sizing: border-box
> Applying everywhere only once:
> Default
> total width = content-area of box
> padding & border are added
separately.
> Can be set via:
box-sizing: content-box
You know where to find me!
webcrat.tech@gmail.com
PS. Keep the subject line as:
[ Web Dev BootCamp ‘ 20 ]
Github @webber2408
LinkedIn @rahul-sharma-25b30b114
Medium @webcrat.tech
References
> Amazon.com
> Undraw.co
> Icons made by Freepik from www.flaticon.com
> MDN (HTML): https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started
> MDN (CSS - Important): https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks
> W3Schools: https://www.w3schools.com/html/
> HTML Semantics: vikingcodeschool.com/html5-and-css3/html5-semantic-tags
> WikiPedia: https://en.wikipedia.org/wiki/Semantic_HTML

Mais conteúdo relacionado

Mais procurados

Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The FabulousNicole Sullivan
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersDarren Gideon
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Nur Fadli Utomo
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processorKannika Kong
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)VIPIN KUMAR
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorialbav123
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSLi-Wei Lu
 
Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)MHR11
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 WorkshopChristopher Schmitt
 
Intro to CSS Selectors in Drupal
Intro to CSS Selectors in DrupalIntro to CSS Selectors in Drupal
Intro to CSS Selectors in Drupalcgmonroe
 

Mais procurados (20)

Css3
Css3Css3
Css3
 
CSS Part II
CSS Part IICSS Part II
CSS Part II
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
The Fast And The Fabulous
The Fast And The FabulousThe Fast And The Fabulous
The Fast And The Fabulous
 
Css3
Css3Css3
Css3
 
An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
CSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI DevelopersCSS101 - Concept Fundamentals for non UI Developers
CSS101 - Concept Fundamentals for non UI Developers
 
Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2Pemrograman Web 3 - CSS Basic Part 2
Pemrograman Web 3 - CSS Basic Part 2
 
Pemrograman Web 2 - CSS
Pemrograman Web 2 - CSSPemrograman Web 2 - CSS
Pemrograman Web 2 - CSS
 
Css3 Presetation
Css3 PresetationCss3 Presetation
Css3 Presetation
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
LESS CSS Pre-processor
LESS CSS Pre-processorLESS CSS Pre-processor
LESS CSS Pre-processor
 
LESS(CSS preprocessor)
LESS(CSS preprocessor)LESS(CSS preprocessor)
LESS(CSS preprocessor)
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSSObject-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
Object-Oriented CSS 從 OOCSS, SMACSS, BEM 到 AMCSS
 
Css3
Css3Css3
Css3
 
Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)Languages for web(HTML,CSS,JS)
Languages for web(HTML,CSS,JS)
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
 
Intro to CSS Selectors in Drupal
Intro to CSS Selectors in DrupalIntro to CSS Selectors in Drupal
Intro to CSS Selectors in Drupal
 

Semelhante a Introduction to CSS3

Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5Taymoor Nazmy
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...JebaRaj26
 
FFW Gabrovo PMG - CSS
FFW Gabrovo PMG - CSSFFW Gabrovo PMG - CSS
FFW Gabrovo PMG - CSSToni Kolev
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Erin M. Kidwell
 
CSS: How To Learn Easily
CSS: How To Learn EasilyCSS: How To Learn Easily
CSS: How To Learn Easilyshabab shihan
 
CSS Walktrough Internship Course
CSS Walktrough Internship CourseCSS Walktrough Internship Course
CSS Walktrough Internship CourseZoltan Iszlai
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layoutCK Yang
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSSSun Technlogies
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsQA TrainingHub
 
Css basics
Css basicsCss basics
Css basicsASIT
 

Semelhante a Introduction to CSS3 (20)

CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
 
Css
CssCss
Css
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 
FFW Gabrovo PMG - CSS
FFW Gabrovo PMG - CSSFFW Gabrovo PMG - CSS
FFW Gabrovo PMG - CSS
 
Css
CssCss
Css
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 
CSS: How To Learn Easily
CSS: How To Learn EasilyCSS: How To Learn Easily
CSS: How To Learn Easily
 
Css
CssCss
Css
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
CSS Walktrough Internship Course
CSS Walktrough Internship CourseCSS Walktrough Internship Course
CSS Walktrough Internship Course
 
Full
FullFull
Full
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
Css basics
Css basicsCss basics
Css basics
 
Css
CssCss
Css
 

Mais de RAHUL SHARMA

Introduction to Web Development
Introduction to Web DevelopmentIntroduction to Web Development
Introduction to Web DevelopmentRAHUL SHARMA
 
Introduction to HTML 5
Introduction to HTML 5Introduction to HTML 5
Introduction to HTML 5RAHUL SHARMA
 
Webpack presentation
Webpack presentationWebpack presentation
Webpack presentationRAHUL SHARMA
 
Introduction to Mixins & OOPS
Introduction to Mixins & OOPSIntroduction to Mixins & OOPS
Introduction to Mixins & OOPSRAHUL SHARMA
 
ECMAScript (2015 - 2019)
ECMAScript (2015 - 2019)ECMAScript (2015 - 2019)
ECMAScript (2015 - 2019)RAHUL SHARMA
 
Mixins & OOPS in JavaScript
Mixins & OOPS in JavaScriptMixins & OOPS in JavaScript
Mixins & OOPS in JavaScriptRAHUL SHARMA
 

Mais de RAHUL SHARMA (6)

Introduction to Web Development
Introduction to Web DevelopmentIntroduction to Web Development
Introduction to Web Development
 
Introduction to HTML 5
Introduction to HTML 5Introduction to HTML 5
Introduction to HTML 5
 
Webpack presentation
Webpack presentationWebpack presentation
Webpack presentation
 
Introduction to Mixins & OOPS
Introduction to Mixins & OOPSIntroduction to Mixins & OOPS
Introduction to Mixins & OOPS
 
ECMAScript (2015 - 2019)
ECMAScript (2015 - 2019)ECMAScript (2015 - 2019)
ECMAScript (2015 - 2019)
 
Mixins & OOPS in JavaScript
Mixins & OOPS in JavaScriptMixins & OOPS in JavaScript
Mixins & OOPS in JavaScript
 

Último

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Introduction to CSS3

  • 2. What’s CSS? > CSS Stands for Cascading Style Sheets. > It describes how HTML elements are to be displayed on screen, paper, or in other media. > External style sheets are stores in a (.css) file. > Checkout same page, different style sheets here, https://www.w3schools.com/css/css_intro.asp Why CSS? > CSS defines styles for our website. Everything will look weird if we don’t style our web pages. > Imagine living in a building without its wall being painted! > Moreover, we all want our customers / visitors to spend some time on the website instead of just closing them at once. Well, to stop them and gain their first impression as the best one, we need to have some awesome styles for the web page! Where would you want to go is why you want to use CSS!
  • 3. CSS Syntax CSS Selectors That’s how we style it! 30 CSS Selector you must memorize: https://code.tutsplus.com/tutorials/the-30-css-selectors-you-must-memorize--net-16048
  • 4. CSS vs CSS3 > Pseudo Classes (Limited) [selector]:pseudo-class{ // CSS Code here } E.g.: :first-child > No support for animations. Animations were added using JavaScript & jQuery (a JavaScript library). > Before CSS3 developers used to develop images that looked like rounded corners. > Not compatible with CSS3 > Much more pseudo classes E.g.: :nth-child() :root :empty > Supports text shadow > Supports animations > Supports border-radius & gradient > Backward Compatible to CSS > They load faster and time required to write them is lesser as compared to that of CSS.
  • 5. Cascading Specificity Inheritance What do you think h1 will be colored as? Cascading means that the order of CSS rules matter. When two rules apply that have equal specificity, the latter one will be used. Specificity basically is a measure of the CSS rule priority. In simple words, it is how the browser decides which rule applies if multiple rules have different selectors Here, class has greater specificity than the HTML tag itself [Rule] Some CSS property values set on parent elements are inherited by their child elements, and some aren't. For example, if you set a color and font-family on an element, every element inside it will also be styled with that color and font, unless you've applied different color and font values directly to them. Some properties do not inherit — for example if you set a width of 50% on an element, all of its descendants do not get a width of 50% of their parent's width. Which properties are inherited by default and which aren't is largely down to common sense.
  • 6. Controlling CSS Inheritance - ( inherit, initial, unset, revert, all ) Takes computed value from the parent. Sets a property to its initial value defined on a per-property basis by the CSS specifications.. Sets a property to its inherited value if it inherits, or to its initial value if not. https://jsbin.com/sayodab/1/edit?html,css,output New additions: > revert : It resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent stylesheet (or by user styles, if any exist). User Agent Style sheets simply refer to the default styles that browsers apply to web pages. > all : Can be used to apply one of these inheritance values to (almost) all properties at once. https://jsbin.com/livugin/1/edit?html,css,output # Unset vs Revert (Important) https://jsbin.com/famagez/2/edit?html,css,output Not same
  • 7. More on Cascade Source Order If you have more than one rule, which has exactly the same weight, then the one that comes last in the CSS will win. Specificity 1) Inline Style - 1000 2) Id selector - 100 3) Class selector (.class, [attributes], :pseudo-class, :hover, :focus, etc.) - 10 4) Element / Tag & Pseudo Elements (h1, :pseudo-elements, :before, :after, :first-element, etc.) - 1 5) :not, * - 0 6) !important - 10,000 Note: 1) The universal selector (*), combinators (+, >, ~, ' '), and negation pseudo-class (:not) have no effect on specificity. 2) Inline > Internal > External 101 100 11
  • 8. CSS Box Model - 1 > Normal : Inline Block > The box will not break into new line. > Width & height properties will not apply. > Only horizontal paddings, margins and borders will apply and will cause other boxes to move away from them. > Vertical padding won’t apply. https://jsbin.com/zexolib/2/edit?html,css,output > E.g. <a>, <span>, <em>, <strong>, etc. > The box will break into new line. > Width & height properties are respected. > Will cover at max 100% by default. > All padding, margin and borders will cause other boxes to move away. > E.g. <div>, <h1>, <p>, etc. > Not Normal : Flex > When flex is set, the outer display turns to block but the inner display is set to flex. > Inline Flex
  • 9. CSS Box Model - 2 Standart Box Model Alternative Box Model > In this model, the content area of box = (total-width of box - border / padding). > Can be set via: box-sizing: border-box > Applying everywhere only once: > Default > total width = content-area of box > padding & border are added separately. > Can be set via: box-sizing: content-box
  • 10. You know where to find me! webcrat.tech@gmail.com PS. Keep the subject line as: [ Web Dev BootCamp ‘ 20 ] Github @webber2408 LinkedIn @rahul-sharma-25b30b114 Medium @webcrat.tech
  • 11. References > Amazon.com > Undraw.co > Icons made by Freepik from www.flaticon.com > MDN (HTML): https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started > MDN (CSS - Important): https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks > W3Schools: https://www.w3schools.com/html/ > HTML Semantics: vikingcodeschool.com/html5-and-css3/html5-semantic-tags > WikiPedia: https://en.wikipedia.org/wiki/Semantic_HTML