Jump to content
xisto Community
Sign in to follow this  
iGuest

Current Page Identifier How to identify a current page in html

Recommended Posts

Hello!I'm a true novice with html, and have a drop down menu that works pretty well. The only thing it doesn't do is identify the current page with a font color, size, or decoration. Any suggestions? Thanks!

Share this post


Link to post
Share on other sites

From what I understand, you have a navigation menu and you want to make sure that it identifies the current page based on the design that you set for it. An example is when the font color changes from blue to red if it's the current page.

The best way would be to create a class called "current-page" and put all CSS designs you want for the menu.

If you have a menu like this:

<ul>	<li><a href="#">Home</a></li>	<li><a href="#">Page 1</a></li>	<li><a href="#">Page 2</a></li>	<li><a href="#">Page 3</a></li></ul>


You can insert (manually or dynamically) the class "current-page". If the visitor goes to Page 2, the code will then look like this:
<ul>	<li><a href="#">Home</a></li>	<li><a href="#">Page 1</a></li>	<li class="current-page"><a href="#">Page 2</a></li>	<li><a href="#">Page 3</a></li></ul>

Now with that, you can specify the design you want to be applied to that class with some CSS. Example
.current-page a:link {	color: red;}

You can try that out. If you're using a CMS (WordPress, Joomla, etc), they have a pre-set class for current or active pages which you will have to use. If you're still confuse, post the source of the page or the link to your site so we can work it out.
Edited by linekill (see edit history)

Share this post


Link to post
Share on other sites

i agree with linekill, it is the only way to identify the current page. and you have may options, you can set a different color in your css file, set a different background color, or change a font weight or add a hover. good luck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.