문제

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

도움이 되었습니까?

해결책

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

다른 팁

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.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top