Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
15,053 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>