How do I center an SVG in a div?
SVG is inline by default. Add display: block to it and then margin: auto will work as expected.
SVG is inline by default. Add display: block to it and then margin: auto will work as expected.
If I correctly understand what you want, you may leave the width and height attributes off the image to maintain aspect ratio and use flexbox to do the centering for you. JSFiddle here I tested this successfully in IE9, Chrome 31, and Opera 18. But no other browsers were tested. As always you must consider … Read more
I have kind of a weird question. On my page I have a main image of a planet in some heavy duty nebula. I have it set up so the min width is 1000px and max is 1500px. I have the sides fading out and this looks great with larger screens. What I’d like to … Read more