How to: Have Multiple Classes
Have Multiple Classes

How to: Have Multiple Classes

Here i will show you an example of how to define a tag with multiple different classes.


<h2 class=”city main”>Example 1</h2>
<h2 class=”city”>Example 2</h2>
<h2 class=”city”>Example 3</h2>


By using the following examples, you can see that example 1 has 2 words in the class unlike the other 2 examples. By doing this, it allows you to separate the two different classes. You can define class “city” and give it a background color of blue, but by using the class “main” you can define that specific example. For example, if you wanted to center the text or change the text color, you can define it with the “main” class.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close Menu