Code:
What I want to do is to highlight the current meny choice. I do this by defining a ID per page, and use this ID to access some CSS code.
I define a variable $pageId, that writes out in header.php to get a dynamic ID per page (which I also did with the webpage title).
But the problem is - it doesn't work and I get an annoying "id='me' > " printed out on the left upper screen. The closest I have got to is to hard-code it (which I don't want to) by writing "<body id='pagename' >" which makes the highlightning work, but it still prints out the text on top.
Here is the code for the subpage:
Code:
<?php
include("incl/config.php");
$pageTitle = "titlename";
$pageId = "me";
$pageStyle = '
figure {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border-color:#5C0A0A;
-moz-box-shadow: 10px 10px 5px #8A0F0F;
-webkit-box-shadow: 10px 10px 5px #8A0F0F;
box-shadow: 10px 10px 5px #8A0F0F;
}
';
?>
<?php include("incl/header.php"); ?>
Code in header.php (where I want to write out the ID).
Code:
<head>
<title><?php echo $pageTitle; ?></title>
<?php if(isset($pageStyle)) : ?>
<style type="text/css">
<?php echo $pageStyle; ?>
</style>
<?php endif; ?>
</head>
<body><?php if(isset($pageId)) echo " id='$pageId' "; ?>>
<!-- Header -->
<header id="above">
<nav class="related">
</nav>
</header>
<header id="top">
<nav class="navmenu">
<a id="me-" href="me.php">Me</a>
</nav>
</header>
And the code in CSS to highlight the meny choice (when body#id and a#id is equal)
Code:
body#me a#me-,
{background:#858585;border:2px solid #656565;}
Anyone knows whats wrong with the code?