SlideShare a Scribd company logo
1 of 21
Download to read offline
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

More Related Content

What's hot

HTML Bootstrap Workshop
HTML Bootstrap WorkshopHTML Bootstrap Workshop
HTML Bootstrap Workshopvincentleeuwen
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Aslam Najeebdeen
 
Getting the most out of Radiant
Getting the most out of RadiantGetting the most out of Radiant
Getting the most out of Radiantjomz83
 
Theme like a monster #ddceu
Theme like a monster #ddceuTheme like a monster #ddceu
Theme like a monster #ddceuMarek Sotak
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsErika 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 newMarek Sotak
 
Flexible site structure with cake php
Flexible site structure with cake phpFlexible site structure with cake php
Flexible site structure with cake phpandygale
 
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 wayMarek Sotak
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme developmentThad Allender
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSSMike Crabb
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingMarek Sotak
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopShay Howe
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSMario Hernandez
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSSdanpaquette
 
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 BootstrapJosh Jeffryes
 

What's hot (20)

HTML Bootstrap Workshop
HTML Bootstrap WorkshopHTML Bootstrap Workshop
HTML Bootstrap Workshop
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
Getting the most out of Radiant
Getting the most out of RadiantGetting the most out of Radiant
Getting the most out of Radiant
 
Theme like a monster #ddceu
Theme like a monster #ddceuTheme like a monster #ddceu
Theme like a monster #ddceu
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & Ids
 
Html5的应用与推行
Html5的应用与推行Html5的应用与推行
Html5的应用与推行
 
Drupal 7 Theming - what's new
Drupal 7 Theming - what's newDrupal 7 Theming - what's new
Drupal 7 Theming - what's new
 
Flexible site structure with cake php
Flexible site structure with cake phpFlexible site structure with cake php
Flexible site structure with cake php
 
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
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSS
 
Atomicant Drupal 6 Theming
Atomicant Drupal 6 ThemingAtomicant Drupal 6 Theming
Atomicant Drupal 6 Theming
 
Html5 nl
Html5 nlHtml5 nl
Html5 nl
 
Modular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS WorkshopModular HTML, CSS, & JS Workshop
Modular HTML, CSS, & JS Workshop
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
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
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 

Similar to Learn CSS inheritance at rocket speed

15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / ColorIn a Rocket
 
11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / CombinatorsIn a Rocket
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903TerryWeber
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13Amanda Case
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best PracticesHolger Bartel
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob 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 - SacramentoSuzette 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 blogigorgentry
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quickBilly Shih
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptIsmaciil2
 

Similar to Learn CSS inheritance at rocket speed (20)

15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
 
11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators11- Learn CSS Fundamentals / Combinators
11- Learn CSS Fundamentals / Combinators
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Ict 8 css
Ict 8 cssIct 8 css
Ict 8 css
 
Fwd week2 tw-20120903
Fwd week2 tw-20120903Fwd week2 tw-20120903
Fwd week2 tw-20120903
 
CSS 101
CSS 101CSS 101
CSS 101
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
 
Front End Best Practices
Front End Best PracticesFront End Best Practices
Front End Best Practices
 
Btk creative-web-03
Btk creative-web-03Btk creative-web-03
Btk creative-web-03
 
Critical Rendering Path
Critical Rendering PathCritical Rendering Path
Critical Rendering Path
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
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
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
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
 
CSS
CSSCSS
CSS
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
 
CSS Refresher
CSS RefresherCSS Refresher
CSS Refresher
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 

More from 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 & itemsIn a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / ContextIn 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 setupIn a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / UnitsIn a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / BackgroundIn a Rocket
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & groupIn a Rocket
 
8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectorsIn a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text FormattingIn 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 MinutesIn a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionIn a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 

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
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
 
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
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
 
8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors8- Learn CSS Fundamentals / Attribute selectors
8- Learn CSS Fundamentals / Attribute selectors
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
 
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
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 

Recently uploaded

定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxBipin Adhikari
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 

Recently uploaded (20)

定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Intellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptxIntellectual property rightsand its types.pptx
Intellectual property rightsand its types.pptx
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 

Learn CSS inheritance at rocket speed

  • 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