1.21 gigawatts
1.21 gigawatts

Reputation: 17726

Is it possible to specify viewBox in CSS?

Is it possible to specify the viewBox attribute on an SVG tag?

I've tried view-box, viewbox, and viewBox and none are applied.

#myRectangle {
  viewbox:0 0 1000 1000;
  width:100;
  height:100;
}
<svg id="myRectangle" 
     xmlns="http://www.w3.org/2000/svg" version="1.1">

  <rect x="10" y="10" width="100" height="100"
        fill="red" stroke="navy" stroke-dasharray="2" stroke-width="4"  />
</svg>

Upvotes: 3

Views: 2726

Answers (1)

Sphinxxx
Sphinxxx

Reputation: 13017

Not at this time. It is proposed for SVG2. More info here: https://github.com/w3c/fxtf-drafts/issues/7

Upvotes: 4

Related Questions