svg size auto
DEMO. You need to define a viewBox on each element that you link to. because there can be different elements in one SVG document. So remove the viewBox from the element you link to. Add a viewBox to the place you're linking from. I suggest you add the, I don't think 'auto' is a valid value for the 'length' attr of a svg image element. Take a look at the spec here. You might want to use '100%'. You could load the image then inspect the width and height onload. JSFiddle: http:
相關軟體 Inkscape 資訊 | |
---|---|
Inkscape 是在 Windows,Mac OS X 和 Linux 上運行的專業質量矢量圖形軟件。它被全世界的設計專業人員和愛好者用來創建各種各樣的圖形,如插圖,圖標,徽標,圖表,地圖和網頁圖形。 Inkscape 選擇版本:Inkscape 0.92.2(32 位)Inkscape 0.92.2(64 位)使用 W3C 開放標準的 SVG(Scalable Vector Graphics)... Inkscape 軟體介紹
svg size auto 相關參考資料
How to Scale SVG | CSS-Tricks
You create a fabulous header logo in Inkscape and you copy and paste the SVG code it spits out into your WordPress header file. Of course, you're not giving up on last year's resolution to al... https://css-tricks.com css - height: auto on SVG not working - Stack Overflow
DEMO. You need to define a viewBox on each element that you link to. because there can be different elements in one SVG document. So remove the viewBox from the element you link to. Add a viewBox to t... https://stackoverflow.com Auto width and height for SVG image - Stack Overflow
I don't think 'auto' is a valid value for the 'length' attr of a svg image element. Take a look at the spec here. You might want to use '100%'. You could load the image th... https://stackoverflow.com css - Autosize an SVG? - Stack Overflow
If the SVG element does not have any width and height attributes, then the width/height should be calculated according to the CSS specs, as pointed out by Robert Longson. However, those values will n... https://stackoverflow.com html - How can I make an svg scale with its parent container ...
<div style= backgroundColor: 'lightpink', resize: 'horizontal', overflow: 'hidden', width: '1000px', height: 'auto', }} > <svg width="100%" ... https://stackoverflow.com javascript - How to get the actual size of an embedded SVG element ...
I actually found the solution which is far less involved (but a bit hacky) than doing aspect ratio calculations. The trick was that I created an invisible line (no stroke) from the top left corner to... https://stackoverflow.com html - How to scale inline SVG to parent containers width and ...
You can set width: 100% & height: auto in svg:not (:root ) selector for this. check updated snippet below. .hero-wave position: absolute; bottom: 20px; left: 0px; right: 0px; width: 100%; height... https://stackoverflow.com javascript - How I can set auto height to svg element? - Stack ...
AFAIK you cannot do this with pure CSS. Your SVG does not specify all required attributes and thus default sizes will be used instead. You will have to specify the viewport/size at the SVG element. T... https://stackoverflow.com css - Inline svg scaling - auto width - Stack Overflow
It appears, by adding max-width to the css for the svg, will format the sizing exactly as i need it. This works for Webkit browsers and Firefox, which fortunately meets my requirements, however if IE... https://stackoverflow.com |