Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are spaces used to separate things in css

Here is something in a wordpress stylesheet that I don't understand:

blockquote cite,
blockquote em,
blockquote i {
font-style: normal;
}

what does the space between blockquote and cite do? I understand if they are separated by a comma, then both blockquote and cite will have "font-style: normal;" now they are separated by space, does this mean if a blockquote tag is embedded into a cite tag it will get "font-style: normal;"?

Thank you.

like image 362
h__ Avatar asked Jul 12 '11 20:07

h__


2 Answers

The space is known as the descendant combinator. blockquote cite selects any cite element within a blockquote element. Likewise for blockquote em and blockquote i.

In other words, it's not "if a blockquote tag is embedded into a cite tag", it's the other way around (besides, you can't place blockquotes in cites in the first place).

As you note, commas group selector sequences into the same rule.

like image 156
BoltClock Avatar answered Sep 28 '22 04:09

BoltClock


This means target the cite tag inside the blockquote etc.

In this instance, the site is attempting to override all italics set inside a blockquote.

like image 31
Jason Gennaro Avatar answered Sep 28 '22 03:09

Jason Gennaro