# Help with css menu

**URL:** <https://boards.straightdope.com/t/help-with-css-menu/451413>\
**Category:** Factual Questions\
**Created:** [June 2, 2008, 12:27am UTC](https://boards.straightdope.com/t/help-with-css-menu/451413 "2008-06-02T00:27:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ice1000](https://avatars.discourse-cdn.com/v4/letter/i/a3d4f5/32.png) [@ice1000](https://boards.straightdope.com/u/ice1000)\
**Post date:** [June 2, 2008, 12:27am UTC](https://boards.straightdope.com/t/help-with-css-menu/451413/1 "2008-06-02T00:27:14Z")

</div>

I’m no css guru so I think this is a simple problem…

I have the dolphin css menu that I got from 13 [styles.com](http://styles.com). I want to get the menu to highlight the active page by changing the image used in the menu.

The 13 styles page says:

> [@](#):
>
> The “About Us” tab has the ON state by adding the “current” class to the A tag.

How do I get the class to change based on the current page?

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [June 2, 2008, 1:06am UTC](https://boards.straightdope.com/t/help-with-css-menu/451413/2 "2008-06-02T01:06:59Z")

</div>

[QUOTE=ice1000]  
I’m no css guru so I think this is a simple problem…

I have the dolphin css menu that I got from 13 [styles.com](http://styles.com). I want to get the menu to highlight the active page by changing the image used in the menu.

The 13 styles page says:  
How do I get the class to change based on the current page?  
[/QUOTE]

See this line in the code in the example?

```auto

<li><a href="http://www.13styles.com" title="css menus" class="current"><span>About Us</span></a></li>

```

You will have to manually insert the class=“current” for the correct page manually, or if you are using dynamic code with SSIs, PHP, or similar, you will need to add logic to your code.

---

<div class="post-metadata">

**Author:** ![ice1000](https://avatars.discourse-cdn.com/v4/letter/i/a3d4f5/32.png) [@ice1000](https://boards.straightdope.com/u/ice1000)\
**Post date:** [June 2, 2008, 2:06am UTC](https://boards.straightdope.com/t/help-with-css-menu/451413/3 "2008-06-02T02:06:06Z")

</div>

[QUOTE=Duckster]  
See this line in the code in the example?

```auto

<li><a href="http://www.13styles.com" title="css menus" class="current"><span>About Us</span></a></li>

```

You will have to manually insert the class=“current” for the correct page manually, or if you are using dynamic code with SSIs, PHP, or similar, you will need to add logic to your code.  
[/QUOTE]

Do you know of a site that has samples of code that can dynamically change the class=“current”?

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [June 2, 2008, 2:09am UTC](https://boards.straightdope.com/t/help-with-css-menu/451413/4 "2008-06-02T02:09:07Z")

</div>

[QUOTE=ice1000]  
Do you know of a site that has samples of code that can dynamically change the class=“current”?  
[/QUOTE]

Are you talking SSIs, PHP, ASP, or what?

---

<div class="post-metadata">

**Author:** ![ice1000](https://avatars.discourse-cdn.com/v4/letter/i/a3d4f5/32.png) [@ice1000](https://boards.straightdope.com/u/ice1000)\
**Post date:** [June 3, 2008, 1:30pm UTC](https://boards.straightdope.com/t/help-with-css-menu/451413/5 "2008-06-03T13:30:42Z")

</div>

vbscript or javascript. client side script.
