on-internet
← Community

How do I center a SVG in a div?

Stack Overflow ·

I have a SVG that I am trying to center in a div. The div has a width of 900px. The SVG has a width of 400px. The SVG has its margin-left and margin-right set to auto. Doesn't work, it just acts as if the left margin is 0 (default). Does Anyone know what's the error?

Comments

Sign in or sign up to comment and upvote.

No comments yet.