user1477955
user1477955

Reputation: 1670

CSS - different approaches of styling a class

Reading the following CSS code I was wondering, what is the difference between a) and b)? Is the first declaration a good way of styling?

a)

.round_box.icon{

  ....
}

b)

.round_box .icon{

  ....
}

Upvotes: 3

Views: 125

Answers (1)

Kalzem
Kalzem

Reputation: 7492

With A : You select all the elements with the 2 classes (at the same time)

With B : You select all the elements with class icon inside all the elements with class round_box

Upvotes: 5

Related Questions