I have this code and the problem is the selected part. So if im in report.php the report tab should be another color wich it is when i do it this way.
<nav class="nav">
<a class="<?= basename($_SERVER['REQUEST_URI']) == "me.php" ? "selected" : "" ?>" href="me.php">Hem</a>
<a class="<?= basename($_SERVER['REQUEST_URI']) == "report.php" ? "selected" : "" ?>" href="report.php">Redovisning</a>
<a class="<?= basename($_SERVER['REQUEST_URI']) == "about.php" ? "selected" : "" ?>" href="about.php">Om</a>
<a class="<?= basename($_SERVER['REQUEST_URI']) == "multipage.php" ? "selected" : "" ?>" href="multipage.php">Multipage</a>
but when i try it this way it doesnt work. What can i do to make it work?
<nav class="nav2">
<a class="<?= basename($_SERVER['REQUEST_URI']) == "?page=intro" ? "selected" : "" ?>" href="?page=intro">Introduction page</a>
Aucun commentaire:
Enregistrer un commentaire