Grow your business, income, & life

20+ yrs of experience to offer you education and business services that launch and grow your business

CSS3 Tutorial for Beginners: 08 Using CSS Classes & Class Selectors

This is Sasha. Thanks for joining me here for another CSS tutorial. In this video, I want to share with you how to use classes. That way, of course, you can learn how to edit your business website a lot better. Let’s take a look at classes.

Structure of classes

The way that classes are done or structured is if you take a look at our current website and what we have here is we basically have H2 tags, H3 tags, and some paragraph tags. If I go ahead and want to target, let’s say, a few of these – let’s say, a few of these different elements over here.

I have the H2 tag and I have the H3 and then H2 over here. H2 tag is targeted right here with this color. Now if I really wanted this color within the – within a certain H2 tag but not the other one. What I could do is create a class. Let’s say both of these are green but I wanted one maybe red instead.

--------------------- HTML CODE ------------------



		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

--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } h2 {color:red;} p {font-size:17px;}

How do we do that? Well, if I go to the second H2 tag and create another one and I do color and, let’s just say, it’s red, go ahead and hit save, now it actually changes both of them to red. That’s kind of a problem. The way that you do that is you do that by targeting with classes, okay?

If I want the second one to be red but the top one to be green, I could just go ahead and type in h2.green, okay? I could just create these names for myself. If I wanted it to be color1, I could do it that way too. Okay, so I’ll go ahead and hit color1. But you can see both of them are now actually back to green right there.

What you need to do is go ahead and input on that right here on the H2 tag style or actually class right here and you just go color1. You put the name here and you can see now I have one tag right here that’s green which is linked up to this and the second one that’s actually red, that’s linked up to this. You can see that they’re both linked together that one is targeting the other one.

--------------------- HTML CODE ------------------



		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

--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } h2.color1 {color:red;} p {font-size:17px;}

Reusing CSS code with classes

One of the great things about CSS is that you can multi-reuse things. If I had color1 and I made it red, you know, I could just take off the H2 tag right there. Let’s say, I wanted to change maybe the product sales and profits right there or even these links right here or the bullets. Let’s go ahead and change it into the table. Let’s say, this product right there, I’ll go ahead and type in class and I’ll say, “Okay, this is color1.” Okay? Boom, right there, color1, and you can see the product got changed. I could go ahead and do the same thing to sales and profits.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } .color1 {color:red;} p {font-size:17px;}

I’m reusing that code and you can see how powerful that is. If I wanted to change that all of a sudden to, let’s say, like a purplish color instead of red color, I could just go ahead and type in that color code right there and you can see it changes it to purple. It makes it really convenient and that way if you have like color2 or, let’s say, item style 2. Let’s just say we’re styling something different and I may want to go ahead just like using the text transform property. In the past, we did uppercase.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } .color1 {color:#9e2fc6;} p {font-size:17px;}

Adding multiple classes

What I could do is add in multiple classes. I could say style2 to a few of these so as you look at this and, let me just save the stylesheet, you can see the product and the sales number is uppercase but not the profits. I could go ahead and add that to the profits as well if I wanted to. You could see and the same thing can happen with the start trading stocks like these books right there.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } .color1 {color:#9e2fc6;} .style2 {text-transform: uppercase;} p {font-size:17px;}

If I just want to add in that text transform property, I could go ahead and do again a class style2 and you can see it right there, start trading stocks now is uppercase but it’s not purple. If I wanted it purple, I could go ahead and just say color1 and now you can see it’s purple there.

Classes and hierarchy

You can see how powerful this can really be as you start mixing and matching things. The only down side with this is if you go ahead and, let’s just say, I add like a hierarchy to it and I go ahead td.style2, it only affects the table column or row depending on what tag you put in right there to be able to do the transformed uppercase.you can see that in this case, the transformed doesn’t apply to the ones at the top or above on the heading because that’s a TH class.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } .color1 {color:#9e2fc6;} td.style2 {text-transform: uppercase;} p {font-size:17px;}

But on the TD class, it does apply because I’ve put the TD right in front of it, okay, with the style2. Okay? Let’s take that back off and you can see now it affects it for anything with the style2 but if I put a hierarchy, the same thing over here. If I do color1, let’s just go ahead and put it only on the TH tag, you’ll also noticed it’ll probably go away with that heading tag that we have right there. There, you can see. This is back to green and only affects the heading because that’s the table heading tag with that color.

You can see how we’re fine-tuning and targeting very specific areas with these classes and again you can have multiple classes. You can have five, 10 different classes. You could put in a size right here. If I wanted certain things to have sizes and I wanted a size element here, font size of, let’s say, 25 pixels, okay?

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } th.color1 {color:#9e2fc6;} .style2 {text-transform: uppercase;} .size {font-size:25px} p {font-size:17px;}

I could go ahead and do that and now when you hit the refresh button you can see that anytime you target the size that one has those elements and I could something over here with the profits as well. Class, I’ll type in size and you can see it there. That number is also targeted and it has that size on that element.

That’s how you ultimately work with classes. You have to have that period in front. If you go ahead and put a tag in front of that firsthand that’s how it forces it to have that element. Now, there’s another little quick tip that I want to mention to you on this is that if you go ahead and have a space before the period, okay, so let’s say, I have a tr.color1 but I have a space, first let’s save it and let’s take a look.

If I have a TR, let me remove some of these. Okay, so now we’re targeting color1, let’s just see where the color1 is. We’re targeting the purple color and you can see where it is everywhere. If I go ahead and do TR which is table row and you can see it doesn’t affect anything there but if I go ahead and add a space, anything that’s first it’s looking for a table row and then anything with the color1, you can see that actually automatically changes it there. Okay?

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } tr .color1 {color:#9e2fc6;} p {font-size:17px;}

That’s ultimately anything with inside a table row with a color of 1 which if you look table row color1, all the headings would match up table row and even the TDs also would match up because there’s a color1 right there. That’s another way to do the hierarchy but if I put them together then it’s actually going to look for anything with the table of row with the color of 1 which as you can see nothing is there.

I would actually have to go ahead and add in a classes and then here color1, hit save and you can see there because that row is there, that would work.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } tr.color1 {color:#9e2fc6;} p {font-size:17px;}

The period together would ultimately mean it has to be targeted for that specific element in that class but if you have a space it’s just looking for a hierarchy and this hierarchy can go pretty deep. As an example here, you can see that here we have – let’s remove this TR and I’ll show you.

Okay, if we have a TR and then we have – get rid of this TD, EM and then start trading stocks right there. Okay, so what could we do is go to TR, TD and EM with a color of 1. Okay? We’ll type in class color1, okay? You can see that this color1 right there works for the start trading stocks.

Let me zoom in right here. Okay, you can see it works for start trading stocks. But if I go ahead and type color1 anywhere else, let’s just say, in a paragraph tag class color1, you could see it doesn’t work because it’s looking first, it’s looking for a table or row then a table column then the EM tag with a color of 1 so that’s how that works.

--------------------- HTML CODE ------------------



		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

Product Sales # Profits
Start Trading Stocks 539 $12,539
Business Launch Pad 109 $1,132
100 Stock Trading Tips 239 $5,229
--------------------- CSS CODE ------------------ h2 { color:#3baf6e; } tr td em.color1 {color:#9e2fc6;} p {font-size:17px;}

We’ll get more into this a little bit later as we get into nesting and defining hierarchies with inheritance properties. But you can see how the classes ultimately work and that’s really where the benefit is. When you have these classes, you can define things as colors. You can define things as margins.

Ultimately, it creates a really powerful way to reuse your CSS because you can do the same thing with font like font size 15 and define it as font size 15 pixels and then just reuse that throughout different pages.

I’ve seen people used that in all sorts of ways. It’s just a matter of how you write the code and how your website is set up and structured.

Download our online toolbox for free! Simply click the get it now button below and see the must-have tools for online business owners!

Struggling to make your blog business profitable? Want to turn your hobby blog into an income-generating blog? Learn the right way to plan a highly successful and profitable blog business.

Learn how to create Pinterest Pins that are attractive, click-worthy, and make people want to click your Pins! Great skill to have to promote your content or make side-income designing Pinterest Pins for others.

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get MyOnline Business Toolbox
 

Had enough of the expensive and useless online business tools?

 

Stop wasting your money and time and get my list of awesome business tools.

 

Just enter your email address below so we know where to send it.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Video Gear Guide for YouTubers

Are you ready to improve your YouTube channel? If you want to see the best YouTube gear for YouTubers, then download my latest gear guide!

 

Enter your email below to get started...

FREE DOWNLOAD

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Wow! Get Ready to Start your Online Business Journey!

Just enter your email address below and be one of the fast growing online businesses roght now!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Get Notified When This Freebie Comes Out! - It Shouldn't Be Long... 

Just enter your email address below and be first to get notified when we release this freebie!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Create Videos that Convert Viewers into Buyers?

Are you tired of making videos that don't produce results?

 

Get my Video Formula cheat sheet and see how to create videos that get clicks and attracts buyers!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My Youtube Video Creation Checklist for FREE...
 

Overwhelmed by number of tasks that you need to do to make high-quality YouTube videos?

 

Then grab this YouTube Video Creation Checklist if a strategic procedure list for producing your YouTube videos.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

This is a List of the 125 Most Profitable YouTube Niches that might be a real eye-opener for you.


Sign up for FREE and gain some extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Profit from My 35 Local Strategies to Make Extra Money
 

Are you interested in making some money on the side? That don't need to be extra hard.

 

You can use My 35 Local Strategies to Make Extra Money and in seriously short time reap the benefits.

 

Grab this opportunity by entering your email below...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

FREE Guide to the Best Cameras for a Youtuber

Eager to find out which cameras are the top choices to producing and recording videos?

 

Grab my FREE Guide below by entering your email address... 

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

225 Profitable Pinterest Niches

Are you interested in learning which Pinterest niches are profitable?

 

Grab our FREE Pinterest Niche Guide by entering your email below

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

How to Get Started Selling Your Own Digital Products

Get my free mini-series by entering your email address below

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Find a Profitable Niche?

If you are interested in starting an online business and want to find the perfect niche to start making tons of money.

 

Then grab our FREE email series on how to find a highly profitable niche!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Want to Get My Quick-Start Guide to Build Your Empire?

If you are interested in starting your own online business and making money online.

 

Then grab our quick email series on how to start a profitable business fast!

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Learn How to Get Thousands of

Visitors to Your Website
 

This FREE email series will show you exactly how to get thousands of real visitors to your website even if you are an absolute beginner.

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

5,000 SUBSCRIBERS

Derek will teach you simple tactics to attract life-long customers through real-world examples.

FOR FREE?

Want to learn how to get

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

Get my list of the 125 Most Profitable YouTube Niches. It will be an eye-opener for you!


Sign up for FREE and get extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

Download My List of The 125 Most Profitable YouTube Niches

Get my list of the 125 Most Profitable YouTube Niches. It will be an eye-opener for you!


Sign up for FREE and get extraordinary ideas...

AWESOME!

In order for you to get your goodies and freebies you have to confirm your email address.

 

To confirm your email address, just go to your email inbox (or check your spam) and click the link that's inside the email that states you want to receive messages from us.

 

That's its!

Just one more thing... 

don't call us.
we will coconut
you

organic pop up market store is heading your way​