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

Drew Butcher
Drew Butcher
33,160 Points

CSS vs CoffeeScript

In the video

http://teamtreehouse.com/library/programming/build-a-simple-ruby-on-rails-application/frontend-development/adding-interactivity

Jim Hoskins adds some CoffeeScript to include a class on the action of hover. My question is: why not just use the suddo class of hover. In other words, in the css file I would have written:

.status:hover .admin {
    display: inline;
}

.status:hover {
    background: #FAFAFA;
}

The end result is the same. Is there an advantage or disadvantage to using the CoffeeScript?

Many thanks, Drew Butcher

2 Answers

I originally thought it was so that when someone hovers over all the whitespace to the right in the status fields, the jQuery would cause the hover effect where CSS wouldn't. However I tested it, and you're right Drew, CSS works pretty much the exact same way. Maybe it was just to intro a bit of coffescript, I s'pose.