Multiple Classes Applied to One HTML Tag

Today we are going to cover a topic that I have been asked about many times, adding more than one CSS class to an HTML tag. This seems like it may be complicated when you first think about ow you could add multiple classes, or even if it’s possible in HTML. In actuality, it is extremely simple.

In order to apply more than one class to an HTML tag, simply just put a space between your CSS classes when you call them in your mark-up. You can have two or more classes applied to a single tag and all of the CSS properties will be called and applied to your page.

<HTML>
<head>

<style type="text/css">
.logo{

	margin-left:100px;
	margin-top:360px;
	position:absolute;
	z-index:1;
}.text{
	color: #FFFFFF;
        background: #000000;
}
</style>
</head>
<body>

<div class="logo text">
DIV TEXT WITH APPLIED CLASSES
</div>

</body>
</html>

It looks like it is too simple to actually be true but this is all you have to do to apply multiple classes to one HTML tag.

Thanks for stopping by!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s