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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:18:25+00:00 2026-06-07T16:18:25+00:00

I want my svg to change its fill when the button it is inside

  • 0

I want my svg to change its fill when the button it is inside of is hovered over.

<set attributeName="fill" to="#AEAEAE" begin="button.mouseover" end="button.mouseout"/>

I thought this would work but it is keeping its original fill of #FF702A

Can anyone help on this?

/////Edit//////

I refactored it to make it simpler. Unless I’m missing some major concept this should be possible with just css?

Here is the html-

 <div id="button">show svg onhover
     <svg id="play" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="42px" height="62px" viewBox="0 0 24 32" style="enable-background:new 0 0 24 32;" xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace">
    <g id="Layer_1">
    </g>
    <g id="play">
      <polygon points="0,0 24,16 0,32  "/>      
    </g>
   </svg>
  </div>

and here is the relevant css

#button {

height: 75px;
width: 275px;
font-size: 25px;
text-align: center;
background: #FF702A;
border-radius: 10px;
padding-top: 40px;
margin-top: 70px;
margin-left: 150px;
opacity: 0.7;
letter-spacing: 1px;
font-variant: small-caps;
color: #EEEEEE; 

}

#button:hover {
opacity: 1.0;
font-size: .01em;

}

#play{
position: absolute;
margin-left: -90px;
margin-top: -10px;
visibility: hidden;

}

#play:hover {
visibility: visible;

}

It’s a hack to hide the text on hover but why isn’t visibility working onhover for the svg? Sorry to take it a different direction from the original question but hopefully this clears things up a bit. Looking to accomplish with pure css..

  • 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-07T16:18:26+00:00Added an answer on June 7, 2026 at 4:18 pm

    You could also just do this with CSS:

    #button { fill: #FF702A; }
    #button:hover { fill: #AEAEAE; }
    

    You’ll have to add the element with id=”button” (and its children if any) to the question if you want an answer to why it isn’t working.

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

Sidebar

Related Questions

I am new to svg and dont know its structure.I want to create 10
I have an SVG file, and I don't want to paste it inside the
I want to add a new line into the svg when, the add button
I want to Embed SVG into XUL. I tried to use the this tutorial
Hello all I am working on javascript jquery and svg.I want to ask a
I want to retrieve declared SVG attributes programmatically. It's all inline content, something like
I want to copy an svg group but I really dont know what I
I use embedded SVG in XHTML and want to create animations from Javascript, but
I have a SVG file that I want to extend by adding onclick handlers
I want to run Protovis javascript from Java and get the evaluated SVG code.

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.