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

PHP

Henry Lin
Henry Lin
11,636 Points

I am confused by the class on Help Please!

Hi guys, I am currently working on the video "Adding Active States to the Navigation" for PHP. I am not sure how this piece of code affects the website. <li class="books<?php if ($section=="books") {echo " on"; } ?>"> I assume that this code does the following things: li class = books => assign the list value a class named books the php code segment says, hey check if $section variable has a value and if the value is "books". if it is books then set the class = "on" So when we load this page, the browser would apply proper css code to this list item. Am i right ??