www.webdeveloper.com
Results 1 to 2 of 2

Thread: CSS & Hover...

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Question CSS & Hover...

    Hi guys,

    I've been doing web development as a hobby for a couple of years. I started with very basic html then moved on to flash (because it's shiny). Recently, I've realised flash isn't great (for a number of reasons I won't go into here) and have gone back to html with a little CSS to give some extra control.

    The point of that intro is to say "please be gentle with me" - I may not conform to 'standard X' or the 'web developers bible' but as long as it works, I'm fairly happy. So, now on to my problem...

    I'm creating a html/css website. I'm using an iframe so I only need to write the code for the header and menu bar once, which then loads each page into the iframe. In the style sheet I have added the following code to make the menu button (and, indeed, all links) show as pink on hover:

    Code:
    a {
    	color: #ffffff;
    	text-decoration: none;
    }
    
    a:visited {
    	color: #ffffff;
    }
    
    a:hover {
    	color: #D99594;
    }
    
    a:active {
    	color: #ffffff;
    }
    This is just a work around to get the effect I wanted, which works. However, my 'client' (friend of a friend blah blah) would really like the menu button to remain in the pink colour when the page is active - does anyone know if this is possible? This would be easy if I weren't using an iframe - I'd just make that menu button pink for the particular page. With an iframe, however, I'm not sure where to start...

    I tried dabbling with a little javascript to change the class of the menu button if it's clicked, but the <a> class seemed to override it. Plus, even if that worked I'd need the button to change all the other menu button back to white at the same time.

    Sorry this post is incredibly long - all help very much appreciated!...

  2. #2
    Join Date
    Mar 2012
    Posts
    63
    For html/css websites,

    you can use javascript to make the active page menu like as "Active"

    use cookie..you can easily get it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles