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

  • SEARCH
  • Home
  • 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 8603883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:25:46+00:00 2026-06-12T02:25:46+00:00

Depending on parent html tag of an SVG object, I would like it’s path

  • 0

Depending on parent html tag of an SVG object, I would like it’s path color to change. Can this be done with SVG? For instance, if a logo is in the header I want it to be red, if it is in the footer I want it to be blue. Here’s an example:

<style type="text/css">
   #header-img {
       fill:blue;
   }

   #footer-img {
       fill:black;
   }

</style>
...
<header>
   <object id="header-img" type="image/svg+xml" data="myimg.svg" />
</header>
...
<footer>
   <object id="footer-img" type="image/svg+xml" data="myimg.svg" />
</footer>

Granted, this can’t be done, but is there an alternative without using JavaScript?

  • 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-12T02:25:48+00:00Added an answer on June 12, 2026 at 2:25 am

    Starting again, this is the best question/answer to your problem that I can find:

    How to apply a style to an embedded SVG?

    It’s possible for you to add a linked stylesheet to the file you wish to embed by hand…
    Thereby avoiding the use of JavaScript.

    I would argue that you should try not to ask redundant questions.
    We’d have both done well to have sourced this earlier.

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

Sidebar

Related Questions

Relevant JS Fiddle http://jsfiddle.net/arosen/FMQtR/ Problem My HTML looks something like this: <div id='parent'> <div
I would like to calculate the width of child-container (div etc) in percentages depending
I've got a parent and child object. Depending on a value in the parent
I would like to understand the Algorithm/implementation of the tag cloud. In tag cloud
I have two categories listed in my DB. I would like to change the
Depending on my task in Vim I have several tabs open. How can I
Depending on the font settings (DPI and such) on the user's computers, I can
This is somehow subjective depending on the target translation language, but bear with me
I've received Mixed responses on this depending what walk-through I read, I've defined a
I need to show/hide some divs depending on selected options. I'm using .change function.

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.