Pregunta

I am trying to embed an external stylesheet in an svgz file. I can embed it just fine into the svg file but it seems to be stripped out when I save as svgz. Any help would be appreciated here is the code from the svg file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">  
<?xml-stylesheet type="text/css" href="/assets/styles/stylesheets/web-fonts.css" ?>
<svg xmlns="http://www.w3.org/2000/svg">  

I am using Illustrator for saving out the files

¿Fue útil?

Solución

I don't know whether SVGZ will work with CSS but SVGZ is a SVG compressed with GZIP.

You can change SVG to SVGZ this way:

  1. get SVG file : example.svg
  2. remove extension .svg : example
  3. compress using GZIP : example.gz
  4. change extenson to .svgz : example.svgz

Otros consejos

The confusion about 7zip seems to be due to how it names things. Only the email options use the word "compress". Use the "Add to archive" option to compress a file without emailing it.

Like furas, I use Inkscape but want to further optimize the SVGs (e.g. remove the metadata element and its contents which Inkscape seems to always add), so can't use it to generate the SVGZ files.

(As a new user, I have to post a new answer instead of a comment on the existing one.)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top