Alfred Zhong Alfred Zhong -4 years ago 136
CSS Question

What is dot something followed by something without dot in CSS

For example,

.foo bar
.foo bam {
<key, values>
... ...

I know .foo selects the "foo" class, but what about the bar and bam? Are they descendants of "foo"? And bar, bam share the key values inside the curly braces?


Answer Source

It means that the styling will only be applied to the "bar" and "bam" elements that are inside of the element with the "foo" class.

<div class="foo">

<div class="meal">

In this example only the "bar" element will get your styling. "bam" would not get the styling since it is not withing an element with a class of "foo".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download