Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6220899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:02:24+00:00 2026-05-24T08:02:24+00:00

When I hover the h2 link, it turns green: HTML: <div class=project> <a rel=bookmark

  • 0

When I hover the h2 link, it turns green:

HTML:

<div class="project">
 <a rel="bookmark" title="Permalink to Taiwantalk" href="http://localhost/asylum/?p=6">
 <img class="attachment-post-thumbnail wp-post-image" width="278" height="128" title="taiwantalk_thumb" alt="taiwantalk_thumb" src="http://localhost/asylum/wp-content/uploads/2011/07/taiwantalk_thumb.png">
 </a>
 <h2>
 <a rel="bookmark" title="Permalink to Taiwantalk" href="http://localhost/asylum/?p=6">Taiwantalk</a>
 </h2>
 <p>Design, HTML, CSS, WordPress</p>
</div>

CSS:

#showcase h2 a:hover {
  color: #682 !important; 
}

I would like the h2 to turn green when I hover the image link too.

I think jQuery is the way to go. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:02:24+00:00Added an answer on May 24, 2026 at 8:02 am
    a:hover+h2
    

    will work in CSS[1]. Using it directly as a jQuery selector will work, but might be cumbersome just to apply styles. Here’s how I might do it if I needed to support the CSS + selector:

    ...
    <style type="text/css">
    #showcase h2 a:hover,
    #showcase a:hover+h2,
    #showcase.colorme h2 { color: #682; }
    </style>
    
    <script type="text/javascript>
    // onload or whatever makes sense:
    $("#showcase>a").hover(
        function(){ $(this).parent().toggleClass("colorme"); },
    )
    </script>
    ...
    

    [1] See http://www.quirksmode.org/css/contents.html for + selector compatibility

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this: HTML: <p class=Link><a href=...>Test1</a></p> <p class=Link><a href=...>Test2</a></p> <p class=Link><a href=...>Test3</a></p> jQuery
HTML: <td align=center width=100%> <a class=Forum_ib_moderate href=Default.aspx title=Moderate></a> <a class=Forum_ib_admin href=Default.aspx title=Admin></a> ... CSS:
I have the following html code: <ul class=smenu> <li class=smenuitem><a href=http://ux.stackexchange.com/></a></li> <li class=smenuitem><a href=http://area51.stackexchange.com/></a></li>
We have many links with rel attributes: <div class=team-tags> <a class=s1 rel=t1 t2 t3
I have an html link that has uses hover() (well, the hoverIntent plugin...but same
Below is the css for a text link in 4 different states - link,visited,hover,
Im trying to take a link either when clicked or hover over be able
I want to change the link-style for some of my links, like this: a:hover
For text links, I have: CSS: a:link {color: #3366a9; text-decoration: none} a:hover {border-bottom: 1px
my Page has many hover images, sometimes there are backgrounds from div-elements or src

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.