when declaring css styles what is the meaning of classA classB two class names with a dot in the middle and no space

0 votes

I know when there is a space in between, it will look for the class on the right within the class on the left.

.classA .classB {
    ...
}

However, what does it look for when there is no space?

.classA.classB {
    ...
}
Jun 28, 2022 in CSS by Edureka
• 13,620 points
447 views

1 answer to this question.

0 votes

The first example (space-separated classes) is a parent-child relationship. .classB is found inside .classA.

<div class="classA">
    <div class="classB"></div>
</div>

The second is for one element with multiple classes, like so:

<div class="classA classB"></div>

Very different situations, but both extremely useful!

answered Jun 28, 2022 by Edureka
• 12,690 points

Related Questions In CSS

0 votes
0 answers

What is the difference between id and class in CSS, and when should I use them?

#main { background: #000; ...READ MORE

Aug 18, 2022 in CSS by Edureka
• 13,620 points
207 views
0 votes
1 answer

What is the meaning of "cascading' in CSS??

Cascading simply implies that it may be ...READ MORE

answered Aug 3, 2022 in CSS by Tanishqa
• 1,170 points
628 views
0 votes
0 answers

what is the difference between xx-large and larger in CSS?

I came across this query when reading ...READ MORE

Aug 19, 2022 in CSS by Edureka
• 13,620 points
305 views
0 votes
0 answers

what is the difference between xx-large and larger in CSS?

I came across this query when reading ...READ MORE

Aug 22, 2022 in CSS by Edureka
• 13,620 points
264 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
9,632 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
2,555 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,360 points
687 views
0 votes
1 answer

What is the proper way to display a logo with CSS?

An <img> element is the proper way ...READ MORE

answered Jun 10, 2022 in CSS by Edureka
• 12,690 points
530 views
0 votes
1 answer

CSS to make HTML page footer stay at bottom of the page with a minimum height, but not overlap the page

A simple solution is to make the ...READ MORE

answered Jun 21, 2022 in CSS by Edureka
• 12,690 points
3,588 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP