Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Noah Schade
Noah Schade
17,694 Points

Help with .open (css)

I'm trying to understand what .open does. .open is not a class in the html file so what is it?

#calendar .ui-datepicker .ui-datepicker-calendar .ui-datepicker-current-day.open {
  margin-bottom: 100px;
}

I got the code from here https://codepen.io/tobiasglaus/pen/YaqJMz

Ethan Rivas
Ethan Rivas
9,979 Points

Hi Noah, Where did you get that code?

1 Answer

Kevin Gates
Kevin Gates
14,854 Points

Where there are spaces between the selectors, that means the one to the right is a child of the one to the left.

.parent-class .child-class {}

So the element could look like this:

<div class="parent-class">
   <div class ="child-class">
   </div>
</div>

When the period, pound/hash symbol is touching the other one, that means it's a further identifier of the same element.

.parent-class .child-class.2nd-class-on-same-child {}

So the element could look like this (notice the space between the classes in the second div below):

<div class="parent-class">
   <div class ="child-class 2nd-class-on-same-child">
   </div>
</div>