HomeОбразованиеRelated VideosMore From: Chidre'sTechTutorials

CSS video tutorial - 10 - CSS Cascade Vs CSS Inheritance

50 ratings | 1818 views
Cascade vs. Inheritance Cascade: deals with precedence of style rules or CSS properties (i.e. the order in which properties are applied to an html element). It solves conflict situations. Let me ask you a question: What happens when we define set of style rules for a specific tag in external, internal as well as inline styles? The answer is: “rules get’s cascade” When we define a set of style rules for a specific tag in external, internal as well as inline style, then browser creates a virtual declaration list by merging all style rules together by following rules of cascade, and then applies the merged virtual declaration list to specified tag. The rules of the cascade include: 1. Later properties (nearest) override earlier (farthest) properties 2. More specific selectors (less generic) override less specific (more generic) selectors Inheritance: deals with how styles poured down from a parent element to its child elements. Certain properties, like font-family gets inherited. If you set a font-family on the body element, then it will get inherited by all the elements within the body. The same is true for color, but it is not true for background color, border-style,margin or height which will always default to transparent, none, auto and auto. ======================================================== Follow the link for next video: https://youtu.be/WwTIrUrnFPA Follow the link for previous video: https://youtu.be/uIjQeBemGgE ========= For more benefits & Be up to date =================== Subscribe to the channel: https://www.youtube.com/chidrestechtu... Like the Facebook fan page: https://www.facebook.com/ManjunathChidre Visit to Chidre's Tech Tutorials website: http://www.chidrestechtutorials.com ========== CSS Questions & Answers ======================== 1. Which CSS style gets inherited to child HTML elements when applied to parent HTML element? a. border-style b. font-family c. background-color d. margin Answer: b ========================================================
Html code for embedding videos on your blog
Text Comments (4)
BLACK (2 months ago)
Superly Explained...thank you
Learn Physics (4 months ago)
great explanation .Plz upload display flex tutorial and postion in css
Anna Koopmans (10 months ago)
Very good explenation!! Keep it up :)
Aivaras Gustys (1 year ago)
Great explanation! Thank you so much! Very detailed, thorough and well explained. Hats off to you sir.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.