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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:12:32+00:00 2026-06-06T19:12:32+00:00

external CSS and inline SVG in a HTML5-document are really giving me a hard

  • 0

external CSS and inline SVG in a HTML5-document are really giving me a hard time.

I’m currently developing under the latest version of Chrome for Mac and wanted to get my SVG, which is styled with an external stylesheet, working for Firefox.

For Chrome, having my SVG-CSS inside the stylesheet for my webpage works fine. I just style all the html-elements and then the SVG-stuff. My stylesheet then looks something like this:

body {
  //blalba
}

<![CDATA[

line {
 //blabla
}

circle {
  //blabla
}

]]>

(works fine under chrome)

Now, if I go that route, all my SVG-elements in Firefox have a black fill, so this doesn’t seem to work. Inline-CSS works fine inside the SVG, but I can’t get external stylesheets to work within the SVG.

Here’s the code I’m fiddling with:

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="styles/style.css" ?>
<svg width="827" height="185" viewBox="0 0 827 185" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <rect class="background" x="0" y="10" width="825" height="125" />
</svg>

I thought this was the correct way to do it, but it works neither in Chrome nor in Firefox. My stylesheet looks something like this:

<![CDATA[ // <- if tried leaving this out, no change

line {
 //blabla
}

circle {
  //blabla
}

]]> // <- if tried leaving this out, no change

I’ve also double-checked the path to my stylesheet. What am I doing wrong?

Thank you for your 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-06T19:12:33+00:00Added an answer on June 6, 2026 at 7:12 pm

    If the SVG is inline in HTML, why not just use the link element like you would for any other stylesheet?

    <link rel="stylesheet" href="styles/style.css">
    

    Here’s an example.

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

Sidebar

Related Questions

We can write CSS as the following types: Inline CSS Embedded CSS External CSS
Using css (not a inline one, but external stylesheet) how do i override the
My requirement is to lookup all the CSS content (external, internal and inline) from
Which one gets applied at the end? CSS from external file inline CSS I
Is there a way to load external CSS files, like we load JS file
I'm unable to reference external files (CSS/JavaScript) when they are located at a parent
It seems that javascript only can ready inline css if i want to check
I'm looking to dynamically generate some inline CSS and was wondering if it was
I know that you can have CSS on External Files, using a <style> tag
I'm making a theme that has inline CSS as a first website at http://flexibilitytheme.tumblr.com/

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.