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 Build a Simple PHP Application Creating the Menu and Footer Adding Active States to the Navigation

On does not underline, but changes background to white

When I insert the code in the video for underlining, it turns the background white rather then underline. I also can no longer link to the page.

<li class="shirts <?php if ($section == "shirts") { echo "on"; } ?>"<a href="shirts.php">Shirts</a></li> <li class="contact <?php if ($section == "contact") { echo "on"; } ?>"<a href="contact.php">Contact</a></li>

1 Answer

in header.php file the section for adding the links is

<ul class="nav">
                <li class="shirts <?php if($section == "shirts") {echo "on"; } ?>"><a href="shirts.php">Shirts</a></li>
                <li class="contact <?php if($section == "contact") {echo "on"; } ?>"><a href="contact.php">Contact</a></li>
                <li class="cart"><a href="#">Shopping Cart</a></li>
            </ul>

the links themselves and should stay the same unless the files in you directory htdocs have moved.