Results 1 to 1 of 1

Thread: Style active internally-linked div

  1. #1
    Join Date
    Sep 2011
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Style active internally-linked div

    Hi,

    Is it possible to style an internally-linked div when it becomes active (or perhaps when it becomes focused is a better phrase in this case)?

    The use case: I've got an image slider at the top of the page. In the html span that slides over each image, I've got an internal link to a div on the page. (So, when someone clicks that link, they're linked to more information on the same page.) Is it possible to style that div so that when the visitor clicks to that div, the background color changes?

    The current code is something like:

    Code:
    <div id="image_slider">
    <img src="widget_1.jpg" />
    <span>Blue widgets are great. <a href="index.html#blue_widgets">Learn more...</a></span>
    </div>
    
    <etc>
    <etc>
    <etc>
    
    <div id="blue_widgets">
    Blue widgets are great because they're blue. And also because they're widgets. 
    </div>
    So when someone clicks that 'learn more' link, which obviously links them within the page to the 'blue_widgets' div further down, I'd also like the 'blue_widgets' div background color to change. Is there any way to do that?

    Thanks for your time.
    Last edited by waterprism; 01-24-2012 at 02:46 AM. Reason: figured it out

Bookmarks

Posting Permissions

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