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
scavence
11,300 PointsDetermine current page in PHP
I somewhat finished the PHP development course and wanted to apply it in a personal project.
a href="portfolio.php" class="portfolio <?php if ($section == "portfolio") { echo "on"; } ?>">Portfolio</a
Here I am applying the trick Randy used in his Simple PHP application course.
echo "<pre>";
echo "portfolo: ";
var_dump($section == "portfolio");
echo "skillset: ";
var_dump($section == "skillset");
echo "about: ";
var_dump($section == "about");
echo "contact: ";
var_dump($section == "contact");
Here I checked the values and each boolean works as expected.
.<code> navigation ul li.on a { text-decoration: underline; color:white; } </code>
In the style.css I found Randy used this to react on the dynamic php selecting method or at least that is what I think he does.
I do not know the li.on (function?) in css. I question how css can determine that the list item is "on" merely on the text that is in the class of the anchor.
Does anyone have an idea on this issue? An explanation or link on this matter would be deeply appreciated.
1 Answer
scavence
11,300 PointsFound the problem. I referred to the list item class but classified the anchor.