This is Sasha and welcome another training video here on CSS. Hopefully, this will give you some more insight on how to edit your business website a little bit better. Let’s take a look at how CSS and inheritance works and how you can use it to your advantage.
Hierarchy in HTML
If you really look at HTML and you see how it’s broken down as far as the hierarchies go, you have HTML first at the very top then you might have the heading tag or the body tag within that. Then within the heading tag, you have the metadata. But we don’t really stylize anything within the heading tag.
There’s no CSS styling that goes into that but it is part of the hierarchy. Within the body area, that’s where we stylize everything. Within the body area, you might have an H1 tag, H2, H3, there might be a paragraph tag or UL tag like an unordered list and within those tags you may even have another level within the inheritance properties.
TItle goes here

Like for an H1 tag, you might an underlined or an emphasis tag and that, of course, is another level and these things can continue to go deeper and deeper and deeper especially as you get in to divs and styling div tags. This can go on for quite a bit of time because the tags continue to have hierarchies and as they’re nested, they continue to evolve.

Inheritance in CSS
Within our example here, if you take a look at the website here that we have, if we go ahead and put something within the body element and let’s just say we change the font color and I can go ahead and change the font color to red, okay? Let me remove this H2 font color right here so you can see everything is black.
I’ll go ahead and change this color to red. I’ll go ahead and hit save and you can see everything including all font colors have changed to red. That includes the forms. That includes everything because the body tag is the highest level.
--------------------- HTML CODE --------------------------------------- CSS CODE ------------------ body {color:red;} h2 { } p {font-size:17px;}Backstageincome : Learn to grow a business and evolve your life! Welcome to My New Website!!!!!
Business Launch Pad is focused on showing you the critical concepts on how to build a profitable business from scratch.These are my books and products
Thank you for visiting

If you want to go ahead and specifically target one of these tags which we’ve kind of covered in the past already and you’ve seen some examples, let’s say, the H2 tag and I want to go ahead and change that color to, let’s say, this green color, what I could is just go ahead and write it since it’s a little bit later down the page.
I can go ahead and just write it and change it to that color and you can see now we have the heading tags for the H2 element green right there. If we go ahead and change the H3 element I can go ahead and do the same thing. I can target that specifically and change it maybe to this blue right here. I’ll go ahead and make that quick little change, go ahead and you’ll notice this H3 tag right there changes to that blue.
--------------------- HTML CODE --------------------------------------- CSS CODE ------------------ body {color:red;} h2 {color:#3baf6e;} h3 {color:#377def;} p {font-size:17px;}Backstageincome : Learn to grow a business and evolve your life! Welcome to My New Website!!!!!
Business Launch Pad is focused on showing you the critical concepts on how to build a profitable business from scratch.These are my books and products
Thank you for visiting

Be careful with the inheritance
Ultimately this is how you do it if you wanted to even target both elements I could have wrote the H3 up here and then all three of those elements would have been targeted but you can see since we’ve put in into the body element that it’s red, it changes it everywhere to red.
This is great for certain things like div tags or a little characters that you want to use and you want to use the same styling throughout like font size and so on but in general, you know, this is something you want be really careful of because it’ll change it everywhere including let’s your paragraph tags.
If I want to go ahead and change this color to black and I know that 0,0,0, we can just write in three 0s for the time being, we can make it black and you can see right there all the paragraph tags now are actually black. Keep in if you didn’t have that, it would take the color red from the body because the body is the highest level.
--------------------- HTML CODE --------------------------------------- CSS CODE ------------------ body {color:red;} h2, h3 {color:#3baf6e;} p {font-size:17px; color:#000;}Backstageincome : Learn to grow a business and evolve your life! Welcome to My New Website!!!!!
Business Launch Pad is focused on showing you the critical concepts on how to build a profitable business from scratch.These are my books and products
Thank you for visiting

Ultimately that’s what inheritance is as you’re inheriting a certain property from that element. If I did the same thing with, let’s say, border 1 pixel solid red right here, you’ll see that on the body there’s the 1 pixel solid red around the body because we’re targeting the body element.
--------------------- HTML CODE --------------------------------------- CSS CODE ------------------ body {color:red; border: 1px solid red;} h2, h3 {color:#3baf6e;} p {font-size:17px;}Backstageincome : Learn to grow a business and evolve your life! Welcome to My New Website!!!!!
Business Launch Pad is focused on showing you the critical concepts on how to build a profitable business from scratch.These are my books and products
Thank you for visiting

In this case, it only affects one thing because of that border. But when it comes to a color, it actually affects multiple things. It doesn’t affect everything but things like text properties like text transform and watch if we do everything uppercase, watch how this actually affects everything.
But a border property doesn’t necessarily do that. There are certain little caveats to it and learning to play with the code, you’ll learn a little bit more about it but anything text related, you’ll see how those things actually get inherited and that’s where some things can cause you to have problems in the future especially as you get into writing more complicated code.
--------------------- HTML CODE --------------------------------------- CSS CODE ------------------ body {color:red; text-transform: uppercase;} h2, h3 {color:#3baf6e;} p {font-size:17px;}Backstageincome : Learn to grow a business and evolve your life! Welcome to My New Website!!!!!
Business Launch Pad is focused on showing you the critical concepts on how to build a profitable business from scratch.These are my books and products
Thank you for visiting

Keep those things in mind as you dig deeper into the code and different properties start inheriting from different areas.