give preferance from two class on a single Element in HTML


Some time we have two class on singe element like

Text1
Text2

.first{color:red;font-size:12px;}
.second{color:green;font-size:12px;}

and we want that “text1” comes in green then we can use !important in css

.first{color:red;font-size:12px;}
.second{color:green !important;font-size:12px;}

now if class second on a element with another class then color attribute of “second” class will be get preference on another one class.

Advertisements

One response to “give preferance from two class on a single Element in HTML

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