CSS Navigation Menu highlight selected menu item
<p>I have developed an CSS navigation menu and for each navigation item I have written php.file. </p>

<p><strong>homepage.php</strong></p>

<p><img src="https://i.stack.imgur.com/LQfht.png" alt="enter image description here"></p>

<pre><code>&lt;html&gt;

&lt;head&gt;
  &lt;title&gt;My First Try Of CSS Navigation Bar&lt;/title&gt;
  &lt;style&gt;
    /* Begin Navigation Bar Styling */
    #nav {
      width: 100%;
      float: left;
      margin: 0 0 3em 0;
      padding: 0;
      list-style: none;
      background-color: #f2f2f2;
      border-bottom: 1px solid #ccc;
      border-top: 1px solid #ccc;
    }
    #nav li {
      float: left;
    }
    #nav li a {
      display: block;
      padding: 8px 15px;
      text-decoration: none;
      font-weight: bold;
      color: #069;
      border-right: 1px solid #ccc;
    }
    #nav li a:hover {
      color: #c00;
      background-color: #fff;
    }
    /*
    End navigation bar styling. */
    /* This is just styling for this
    specific page. */
    body {
      background-color: #555;
      font: small/1.3 Arial, Helvetica, sans-serif;
    }
    #wrap {
      width: 900px;
      margin: 0 auto;
      background-color: #fff;
    }
    h1 {
      font-size: 1.5em;
      padding: 1em 8px;
      color: #333;
      background-color: #069;
      margin: 0;
    }
    #content {
      padding: 0 50px 50px;
    }
    .active {
      background-color: red;
    }
  &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;div id="wrap"&gt;
    &lt;h1&gt;Shree Shree Property, Kolhapur&lt;/h1&gt; 
    &lt;!-- Here's all it takes to make this navigation bar. --&gt;
    &lt;ul id="nav"&gt;
      &lt;li&gt;&lt;a href="riteshproject/home.php"&gt;Home&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;About US&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Contact
    US&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;Login&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
    &lt;!-- That's it! --&gt;
    &lt;div id="content"&gt;Area
      &lt;tr&gt;
        &lt;td height="20px" /&gt;

        &lt;td style="text-align:left"&gt;

          &lt;select name="leavetype" id="leavetype"&gt;
            &lt;?php $query="select code,areaname from areamaster" ; $query_run=mysql_query($query); mysql_num_rows($query_run); while($row=mysql_fetch_assoc($query_run)) { ?&gt;
            &lt;option value="&lt;?php echo $row['code']?&gt;"&gt;
              &lt;?php echo $row[ 'areaname']?&gt;
            &lt;/option&gt;
            &lt;?php } ?&gt;
          &lt;/select&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p><br>
<strong>aboutus.php</strong></p>

<p><img src="https://i.stack.imgur.com/4xOBM.png" alt="enter image description here"></p>

<pre><code>    &lt;?php include( "$_SERVER[DOCUMENT_ROOT]/riteshproject/config.php"); ?&gt;
&lt;html&gt;

&lt;head&gt;
  &lt;title&gt;Shree Shree Property,Kolhapur&lt;/title&gt;
  &lt;style&gt;
    /* Begin Navigation Bar Styling */
    #nav {
      width: 100%;
      float: left;
      margin: 0 0 5em 0;
      padding: 0;
      list-style: none;
      background-color: #f3f3f3;
      border-bottom: 1px solid #ccc;
      border-top: 1px solid #ccc;
    }
    ul.primary li:hover a {
      background: pink;
      color: #666;
      text-shadow: none;
    }
    #nav li {
      float: left;
      background: #0080ff;
    }
    #nav li a {
      display: block;
      padding: 8px 17.5px;
      text-decoration: none;
      font-weight: bold;
      color: black;
      border-right: 1px solid #ccc;
    }
    #nav li a:hover {
      color: black;
      background-color: #00bfff;
    }
    /* End navigation bar styling. */
    /* This is just styling for this specific page.
    */
    body {
      background-color: #555;
      font: small/1.3 Arial, Helvetica, sans-serif;
    }
    #wrap {
      width: 900px;
      margin: 0 auto;
      background-color: #00bfff;
    }
    h1 {
      font-size: 1.5em;
      padding: 1em 8px;
      color: #333;
      background-color: #069;
      margin: 0;
    }
    #content {
      padding: 0 50px 50px;
    }
    h4 {
      font-size: 1.1em;
      float: center;
      padding: 1em 8px;
      color: #333;
      background-color: #00bfff;
      margin: 0;
      -webkit-align-content: center;
      align-content: center;
    }
    #content {
      padding: 1em 8px;
    }
    #current a {
      color: #ff0000;
    }
    #dddd {
      color: red;
    }
    .active {
      background-color: red;
    }
  &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;div id="wrap"&gt;
    &lt;form name="tstest" action="test20.php" onsubmit="return CommonFunction(this);   method=" POST "&gt;    &lt;h1&gt;Shree
    Shree Property, Kolhapur&lt;/h1&gt;
             &lt;!-- Here's all it takes to make this navigation bar. --&gt;   &lt;ul id="nav "&gt;
            &lt;li&gt;&lt;a href="../riteshproject/home.php " class="active "&gt;Home&lt;/a&gt;&lt;/li&gt;      &lt;li class="current " id="dddd "&gt;&lt;a
    href="../riteshproject/aboutus.php "&gt;About US&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a
    href="# "&gt;Contact US&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="# "&gt;Login&lt;/a&gt;&lt;/li&gt;         &lt;li&gt;&lt;a href="# "&gt;Add Property&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="# "&gt;Luxarious Property&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="# "&gt;Property For Sale&lt;/a&gt;&lt;/li&gt;         &lt;li&gt;&lt;a href="# "&gt;Other
    Services&lt;/a&gt;&lt;/li&gt;    &lt;/ul&gt;   &lt;!-- That's it! --&gt;  &lt;div&gt;    &lt;html&gt; 
    &lt;body&gt;     &lt;div id="wrap "&gt;

      &lt;h4&gt;Shree Shree Property&lt;h4&gt;   &lt;p&gt;Shree Shree Property provides
    leading property consultancy in Kolhapur&lt;/p&gt;   &lt;/div&gt;

     &lt;body&gt;  &lt;/html&gt;     &lt;/form&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt;

    &lt;/body&gt; &lt;/html&gt;
</code></pre>

<p>i need to set color of only home menu that is first from left manu. then
i need to change color of only selected menu background
and whenver i navigate to another menu that menu color also need to change
and previously changed menu's color need as like i at home page </p>