Sireini
Sireini

Reputation: 4262

How to prevent SVG background image from scaling?

I have a SVG background image which scales with browser window when I scale the browser window. How can I prevent the svg background from scaling?

Here is the class:

.share-btn-bg {
  background: url("../assets/img/share-bg.svg");
}

How can I add css styling to prevent image background from scaling down?

Upvotes: 1

Views: 788

Answers (2)

Vikas Jadhav
Vikas Jadhav

Reputation: 4692

Or you can set max-width to image to prevent.

Upvotes: 0

Johannes
Johannes

Reputation: 67738

Add a background-size; setting to that CSS rule, for example background-size:auto; or background-size: 100px 60px; or whatever you wish.

Upvotes: 3

Related Questions