SlideShare a Scribd company logo
IN A ROCKET
Learn front-end development at rocket speed
CSS CSS FUNDAMENTALS
Inheritance
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
INHERITANCE
Some properties on a selector are inherited by all the children of that selector.
div { color: green; }
Hello world!
p
I've inherited the color of my parent.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE
<body>
<main>
Here starts the main area of this site.
<article>
<p>We hope you enjoy this article.</p>
</article>
</main>
</body>
main { color: green; }
Web page title
index.html
Here starts the main area of this site.

We hope you enjoy this article.
 Inherited
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
INHERITANCE: PROPERTIES THAT INHERIT
border-collapse

border-spacing

caption-side

color

cursor

direction

empty-cells
font-family

font-size

font-style

font-variant

font-weight

font-size-adjust

font-stretch

font

letter-spacing

line-height
list-style-image

list-style-position

list-style-type

list-style
orphans

quotes

tab-size
text-align

text-align-last

text-decoration-color

text-indent

text-justify

text-shadow

text-transform
visibility

white-space

widows

word-break

word-spacing
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
CONTROL INHERITANCE
INITIAL UNSETINHERIT
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
“The inherit keyword causes the element for which it is specified to take
the computed value of the property from its parent element.”
SOURCE: Inherit by MDN.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE: INHERIT
<body>
<h2>A normal header</h2>
<header>
<h2>I should be blue but I'm inheriting
green</h2>
</header>
</body>
h2 { color: blue; }
header { color: green; }
header h2 { color: inherit; }
Web page title
index.html
A normal header
I should be blue but I'm inheriting green
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
CONTROL INHERITANCE
INITIAL UNSETINHERIT
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
“The initial keyword applies the initial value of a property to an element. 

It is allowed on every CSS property.”
SOURCE: Initial by MDN.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
EXAMPLE: COLOR PROPERTY
SOURCE: Color by W3c.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
EXAMPLE: FONT-SIZE PROPERTY
SOURCE: Font-size by W3c.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE: INITIAL
<body>
<main>
<h1>Here starts the main area<h1>
<article>
<p>We hope you enjoy this article.</p>
</article>
</main>
</body>
main { color: green; }
p { color: initial; }
Web page title
index.html
Here starts the main area of this site.

We hope you enjoy this article.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE: INITIAL + ALL
<body>
<main>
Here starts the main area of this site.
<article>
<p>We hope you enjoy this article.</p>
</article>
</main>
</body>
main {
color: green;
font-size: 200%;
}
p { all: initial; }
Web page title
index.html
Here starts the main area of this site.

We hope you enjoy this article.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
CONTROL INHERITANCE
INITIAL UNSETINHERIT
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
The unset keyword resets a property 

1. to its inherited value if it inherits from its parent, and 

2. to its initial value if not.
SOURCE: Unset by MDN.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE: UNSET
<body>
<p>All paragraphs are blue.</p>
<header>
<p>My parent is red but I'm a paragraph.</p>
</header>
<main>
<p>I should be blue but I'm resetting to my
parent's color.</p>
</main>
</body>
p { color: blue; }
header { color: red; }
main { color: green; }
main p { color: unset; }
Web page title
index.html
All paragraphs are blue.

My parent is red but I'm a paragraph.

I should be blue but I'm resetting to my parent's color.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
INHERITANCE: UNSET
<body>
<p>All paragraphs are blue.</p>
<header>
<p>My parent is red but I'm a paragraph.</p>
</header>
<main>
<p>I don't inherit any color from my parent so I
just reset to initial.</p>
</main>
</body>
p { color: blue; }
header { color: red; }
main { /* No color */ }
main p { color: unset; }
Web page title
index.html
All paragraphs are blue.

My parent is red but I'm a paragraph.

I don't inherit any color from my parent so I just reset to initial.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
CONTROL INHERITANCE
INITIAL UNSETINHERIT
Learn front-end development at rocket speed
inarocket.com
by miguelsanchez.com
YOU CAN CONTINUE THIS COURSE FOR FREE ON
+ READY TO USE CODE
+ QUIZZES
+ FREE UPDATES
We respect your time

No more blah blah videos. Just straight to
the point slides with relevant information.
Ready to use code

Real code you can just copy and paste into
your real projects.
Step by step guides

Clear and concise steps to build real use
solutions. No missed points.
Learn front-end development at rocket speed
inarocket.com
IN A ROCKET
Learn front-end development at rocket speed
CSS CSS FUNDAMENTALS
Inheritance
Ad

More Related Content

What's hot (20)

HTML Bootstrap Workshop
HTML Bootstrap WorkshopHTML Bootstrap Workshop
HTML Bootstrap Workshop
vincentleeuwen
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
Aslam Najeebdeen
 
Getting the most out of Radiant
Getting the most out of RadiantGetting the most out of Radiant
Getting the most out of Radiant
jomz83
 
Theme like a monster #ddceu
Theme like a monster #ddceuTheme like a monster #ddceu
Theme like a monster #ddceu
Marek Sotak
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & Ids
Erika Tarte
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
Sofish Lin
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
Marek Sotak
 
Flexible site structure with cake php
Flexible site structure with cake phpFlexible site structure with cake php
Flexible site structure with cake php
andygale
 
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal way
Marek Sotak
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
Thad Allender
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSS
Mike Crabb
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
Marek Sotak
 
Html5 nl
Html5 nlHtml5 nl
Html5 nl
Wilfred Nas
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
Gilbert Guerrero
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
danpaquette
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with Bootstrap
Josh Jeffryes
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
Randy Oest II
 
HTML Bootstrap Workshop
HTML Bootstrap WorkshopHTML Bootstrap Workshop
HTML Bootstrap Workshop
vincentleeuwen
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
Aslam Najeebdeen
 
Getting the most out of Radiant
Getting the most out of RadiantGetting the most out of Radiant
Getting the most out of Radiant
jomz83
 
Theme like a monster #ddceu
Theme like a monster #ddceuTheme like a monster #ddceu
Theme like a monster #ddceu
Marek Sotak
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & Ids
Erika Tarte
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
Sofish Lin
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
Marek Sotak
 
Flexible site structure with cake php
Flexible site structure with cake phpFlexible site structure with cake php
Flexible site structure with cake php
andygale
 
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal way
Marek Sotak
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
Thad Allender
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSS
Mike Crabb
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
Marek Sotak
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
danpaquette
 
Rapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with BootstrapRapid and Responsive - UX to Prototype with Bootstrap
Rapid and Responsive - UX to Prototype with Bootstrap
Josh Jeffryes
 

Similar to 14- Learn CSS Fundamentals / Inheritance (20)

15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
In a Rocket
 
11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators
In a Rocket
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
Idan Gazit
 
Ict 8 css
Ict 8 cssIct 8 css
Ict 8 css
Christian Reglos
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
TerryWeber
 
CSS 101
CSS 101CSS 101
CSS 101
dunclair
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
Amanda Case
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
Holger Bartel
 
Btk creative-web-03
Btk creative-web-03Btk creative-web-03
Btk creative-web-03
Lukas Oppermann
 
Critical Rendering Path
Critical Rendering PathCritical Rendering Path
Critical Rendering Path
BarbaraFellner1
 
properties of css.pptx power pointpresentation
properties of css.pptx power pointpresentationproperties of css.pptx power pointpresentation
properties of css.pptx power pointpresentation
Coderkids
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
Rob Davarnia
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
Suzette Franck
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
Meenakshi Paul
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blog
igorgentry
 
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docxINTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
psaranya21
 
CSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptxCSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
 
CSS
CSSCSS
CSS
Mallikarjuna G D
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
Billy Shih
 
15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
In a Rocket
 
11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators
In a Rocket
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
TerryWeber
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
Amanda Case
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
Holger Bartel
 
properties of css.pptx power pointpresentation
properties of css.pptx power pointpresentationproperties of css.pptx power pointpresentation
properties of css.pptx power pointpresentation
Coderkids
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
Rob Davarnia
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
Suzette Franck
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blog
igorgentry
 
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docxINTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
INTERNET PROGRAMMING UNIT I REMAINING -SECOND HALF.docx
psaranya21
 
CSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptxCSS ppt of cascading Style sheet for beginners.pptx
CSS ppt of cascading Style sheet for beginners.pptx
HarshSahu509641
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
Billy Shih
 
Ad

More from In a Rocket (11)

3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
In a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
In a Rocket
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors
In a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
In a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
In a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
In a Rocket
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors
In a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
In a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
Ad

Recently uploaded (13)

Cloud-to-cloud Migration presentation.pptx
Cloud-to-cloud Migration presentation.pptxCloud-to-cloud Migration presentation.pptx
Cloud-to-cloud Migration presentation.pptx
marketing140789
 
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdfGiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
Giacomo Vacca
 
plataforma virtual E learning y sus características.pdf
plataforma virtual E learning y sus características.pdfplataforma virtual E learning y sus características.pdf
plataforma virtual E learning y sus características.pdf
valdiviesovaleriamis
 
introduction to html and cssIntroHTML.ppt
introduction to html and cssIntroHTML.pptintroduction to html and cssIntroHTML.ppt
introduction to html and cssIntroHTML.ppt
SherifElGohary7
 
Paper: World Game (s) Great Redesign.pdf
Paper: World Game (s) Great Redesign.pdfPaper: World Game (s) Great Redesign.pdf
Paper: World Game (s) Great Redesign.pdf
Steven McGee
 
IoT PPT introduction to internet of things
IoT PPT introduction to internet of thingsIoT PPT introduction to internet of things
IoT PPT introduction to internet of things
VaishnaviPatil3995
 
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCONJava developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Jago de Vreede
 
Breaking Down the Latest Spectrum Internet Plans.pdf
Breaking Down the Latest Spectrum Internet Plans.pdfBreaking Down the Latest Spectrum Internet Plans.pdf
Breaking Down the Latest Spectrum Internet Plans.pdf
Internet Bundle Now
 
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
werhkr1
 
Presentation Mehdi Monitorama 2022 Cancer and Monitoring
Presentation Mehdi Monitorama 2022 Cancer and MonitoringPresentation Mehdi Monitorama 2022 Cancer and Monitoring
Presentation Mehdi Monitorama 2022 Cancer and Monitoring
mdaoudi
 
ProjectArtificial Intelligence Good or Evil.pptx
ProjectArtificial Intelligence Good or Evil.pptxProjectArtificial Intelligence Good or Evil.pptx
ProjectArtificial Intelligence Good or Evil.pptx
OlenaKotovska
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness GuideThe Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
russellpeter1995
 
Cloud-to-cloud Migration presentation.pptx
Cloud-to-cloud Migration presentation.pptxCloud-to-cloud Migration presentation.pptx
Cloud-to-cloud Migration presentation.pptx
marketing140789
 
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdfGiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
GiacomoVacca - WebRTC - troubleshooting media negotiation.pdf
Giacomo Vacca
 
plataforma virtual E learning y sus características.pdf
plataforma virtual E learning y sus características.pdfplataforma virtual E learning y sus características.pdf
plataforma virtual E learning y sus características.pdf
valdiviesovaleriamis
 
introduction to html and cssIntroHTML.ppt
introduction to html and cssIntroHTML.pptintroduction to html and cssIntroHTML.ppt
introduction to html and cssIntroHTML.ppt
SherifElGohary7
 
Paper: World Game (s) Great Redesign.pdf
Paper: World Game (s) Great Redesign.pdfPaper: World Game (s) Great Redesign.pdf
Paper: World Game (s) Great Redesign.pdf
Steven McGee
 
IoT PPT introduction to internet of things
IoT PPT introduction to internet of thingsIoT PPT introduction to internet of things
IoT PPT introduction to internet of things
VaishnaviPatil3995
 
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCONJava developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Java developer-friendly frontends: Build UIs without the JavaScript hassle- JCON
Jago de Vreede
 
Breaking Down the Latest Spectrum Internet Plans.pdf
Breaking Down the Latest Spectrum Internet Plans.pdfBreaking Down the Latest Spectrum Internet Plans.pdf
Breaking Down the Latest Spectrum Internet Plans.pdf
Internet Bundle Now
 
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
DEF CON 25 - Whitney-Merrill-and-Terrell-McSweeny-Tick-Tick-Boom-Tech-and-the...
werhkr1
 
Presentation Mehdi Monitorama 2022 Cancer and Monitoring
Presentation Mehdi Monitorama 2022 Cancer and MonitoringPresentation Mehdi Monitorama 2022 Cancer and Monitoring
Presentation Mehdi Monitorama 2022 Cancer and Monitoring
mdaoudi
 
ProjectArtificial Intelligence Good or Evil.pptx
ProjectArtificial Intelligence Good or Evil.pptxProjectArtificial Intelligence Good or Evil.pptx
ProjectArtificial Intelligence Good or Evil.pptx
OlenaKotovska
 
How to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabberHow to Install & Activate ListGrabber - eGrabber
How to Install & Activate ListGrabber - eGrabber
eGrabber
 
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness GuideThe Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
The Hidden Risks of Hiring Hackers to Change Grades: An Awareness Guide
russellpeter1995
 

14- Learn CSS Fundamentals / Inheritance

  • 1. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS Inheritance
  • 2. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com INHERITANCE Some properties on a selector are inherited by all the children of that selector. div { color: green; } Hello world! p I've inherited the color of my parent.
  • 3. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE <body> <main> Here starts the main area of this site. <article> <p>We hope you enjoy this article.</p> </article> </main> </body> main { color: green; } Web page title index.html Here starts the main area of this site. We hope you enjoy this article. Inherited
  • 4. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com INHERITANCE: PROPERTIES THAT INHERIT border-collapse border-spacing caption-side color cursor direction empty-cells font-family font-size font-style font-variant font-weight font-size-adjust font-stretch font letter-spacing line-height list-style-image list-style-position list-style-type list-style orphans quotes tab-size text-align text-align-last text-decoration-color text-indent text-justify text-shadow text-transform visibility white-space widows word-break word-spacing
  • 5. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com CONTROL INHERITANCE INITIAL UNSETINHERIT
  • 6. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com “The inherit keyword causes the element for which it is specified to take the computed value of the property from its parent element.” SOURCE: Inherit by MDN.
  • 7. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE: INHERIT <body> <h2>A normal header</h2> <header> <h2>I should be blue but I'm inheriting green</h2> </header> </body> h2 { color: blue; } header { color: green; } header h2 { color: inherit; } Web page title index.html A normal header I should be blue but I'm inheriting green
  • 8. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com CONTROL INHERITANCE INITIAL UNSETINHERIT
  • 9. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com “The initial keyword applies the initial value of a property to an element. It is allowed on every CSS property.” SOURCE: Initial by MDN.
  • 10. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com EXAMPLE: COLOR PROPERTY SOURCE: Color by W3c.
  • 11. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com EXAMPLE: FONT-SIZE PROPERTY SOURCE: Font-size by W3c.
  • 12. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE: INITIAL <body> <main> <h1>Here starts the main area<h1> <article> <p>We hope you enjoy this article.</p> </article> </main> </body> main { color: green; } p { color: initial; } Web page title index.html Here starts the main area of this site. We hope you enjoy this article.
  • 13. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE: INITIAL + ALL <body> <main> Here starts the main area of this site. <article> <p>We hope you enjoy this article.</p> </article> </main> </body> main { color: green; font-size: 200%; } p { all: initial; } Web page title index.html Here starts the main area of this site. We hope you enjoy this article.
  • 14. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com CONTROL INHERITANCE INITIAL UNSETINHERIT
  • 15. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com The unset keyword resets a property 1. to its inherited value if it inherits from its parent, and 2. to its initial value if not. SOURCE: Unset by MDN.
  • 16. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE: UNSET <body> <p>All paragraphs are blue.</p> <header> <p>My parent is red but I'm a paragraph.</p> </header> <main> <p>I should be blue but I'm resetting to my parent's color.</p> </main> </body> p { color: blue; } header { color: red; } main { color: green; } main p { color: unset; } Web page title index.html All paragraphs are blue. My parent is red but I'm a paragraph. I should be blue but I'm resetting to my parent's color.
  • 17. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser INHERITANCE: UNSET <body> <p>All paragraphs are blue.</p> <header> <p>My parent is red but I'm a paragraph.</p> </header> <main> <p>I don't inherit any color from my parent so I just reset to initial.</p> </main> </body> p { color: blue; } header { color: red; } main { /* No color */ } main p { color: unset; } Web page title index.html All paragraphs are blue. My parent is red but I'm a paragraph. I don't inherit any color from my parent so I just reset to initial.
  • 18. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com CONTROL INHERITANCE INITIAL UNSETINHERIT
  • 19. Learn front-end development at rocket speed inarocket.com by miguelsanchez.com YOU CAN CONTINUE THIS COURSE FOR FREE ON + READY TO USE CODE + QUIZZES + FREE UPDATES
  • 20. We respect your time
 No more blah blah videos. Just straight to the point slides with relevant information. Ready to use code
 Real code you can just copy and paste into your real projects. Step by step guides
 Clear and concise steps to build real use solutions. No missed points. Learn front-end development at rocket speed inarocket.com
  • 21. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS Inheritance