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

JavaScript

Paul Barron
Paul Barron
6,595 Points

Sass vs. Javascript

Which would I use to manipulate div size properties? I'm wondering which I should learn next.

3 Answers

The debate over whether or not you should use Javascript vs. CSS in a particular instance, should be based upon whether or not the content being manipulated is important to the site. If a user has Javascript disabled (for some reason), you don't want a key feature to be lost due to this. This is one of the reasons why the foundations/key features of navigations are built with CSS over Javascript. If the intent is simply to add presentation to the page, and the loss of this content is not important, then it's fine to use Javascript.

Michael Hulet
Michael Hulet
47,913 Points

It depends on when you want them manipulated. If you want them manipulated after a user loads your site (i.e. as an animation or as part of some of your site's functionality), use JavaScript. Else, use Sass

Marcus Tisรคter
Marcus Tisรคter
4,886 Points

Don't use Javascript to change size, use SASS.