abo tbileli
abo tbileli

Reputation: 11

SVG dynamic width and height from html or css

I want give my SVG element dynamic width and height and want to show full my SVG image.

Example: http://codepen.io/anon/pen/EWqRxp?editors=1010

<svg width="250" height="250" viewBox="0 0 250 250">

or

.svg {
  width : 250px;
  height: 250px;
}

I want to show full map in 250x250 box.

I tried everything for this but ....

Upvotes: 0

Views: 761

Answers (1)

Paul LeBeau
Paul LeBeau

Reputation: 101830

Your viewBox is wrong. "0 0 250 250" is not a suitable value for your SVG.

More suitable values for your SVG would be something like: "0 398 612 394".

http://codepen.io/anon/pen/QpeVNW?editors=1010

Upvotes: 1

Related Questions