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 8577817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:14:41+00:00 2026-06-11T20:14:41+00:00

In my HTML below, when I hover on the <a> element I want to

  • 0

In my HTML below, when I hover on the <a> element I want to change the colour of the <h1> element using only CSS. Is there a way to achieve this?

<h1>Heading</h1>
<a class="button" href="#"></a>

What if I wrap a div around it with an id in it?

<div id="banner">
    <h1>Heading</h1>
    <a class="button" href="#"></a>
</div>

Will this help?

  • 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-06-11T20:14:42+00:00Added an answer on June 11, 2026 at 8:14 pm

    There is no CSS selector that can do this (in CSS3, even). Elements, in CSS, are never aware of their parent, so you cannot do a:parent h1 (for example). Nor are they aware of their siblings (in most cases), so you cannot do #container a:hover { /* do something with sibling h1 */ }. Basically, CSS properties cannot modify anything but elements and their children (they cannot access parents or siblings).

    You could contain the h1 within the a, but this would make your h1 hoverable as well.

    You will only be able to achieve this using JavaScript (jsFiddle proof-of-concept). This would look something like:

    $("a.button").hover(function() {
        $(this).siblings("h1").addClass("your_color_class");
    }, function() {
        $(this).siblings("h1").removeClass("your_color_class");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dropdown using CSS and HTML below: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
I am using jQuery UI 's tab view. I have included my HTML below,
Conside below html - <div class=container1> <div class=container2> <div class=container3> <div class=container4> <div class=element>
I have the jQuery function below which alters the CSS on hover of a
I have created a simple layout with Html and CSS which is like below
This is what my current code looks like: HTML: <a class=button href=#>Read More</a> CSS:
I'm trying to slide background on hover. I used the code below in HTML
The jquery code below does exactly what I want it to do on hover.
The HTML below will show a page with 2 buttons. One will open a
If I have the HTML below: <div style=display:none;> <span id=hello>Hey</span> </div> And I do

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.