Highlight the current page in the menu bar

后端 未结 1 828
萌比男神i
萌比男神i 2021-01-16 10:45

How can I change the menu color when the page is selected?

Example:

home faq contact_us

I want to show which page is se

1条回答
  •  温柔的废话
    2021-01-16 10:56

    Well, if you're writing the menu to each page (as seems to be the case from your comments) there's nothing stopping you from changing the background colour for the specific

  • related to that page.

    Example below showing white background for current page (Home) or default colour for non-active pages.

  • Home
  • FAQ
  • Contact Us
  • Alternatively you could use some script and create tabs like I have done in this fiddle: http://jsfiddle.net/gstubbenhagen/zAbmA/

    I would only recommend the tabs if you don't have too much content on each page as you don't want to make 1 very large page which takes forever to load on slower connections.

    NOTE: If using the tabs option the example provided uses a JQuery plugin, make sure you add the same tools if you are not going to re-code.

0 讨论(0)
提交回复
热议问题