+ 5

[OFF-TOPIC]SVG Alignment

How can I align SVG to the center of the webpage using CSS. That will be align to the center from any device.

10th Apr 2018, 10:37 AM
Warith Vatanaplachaigoon
Warith Vatanaplachaigoon - avatar
9 Answers
10th Apr 2018, 10:31 PM
Olga
+ 5
Here Olga https://code.sololearn.com/W918sUH9h2i3/?ref=app Try to use iPad or Tablet to solved this question. If you see this in smartphone. I'd already set the x,y points of my SVG. So it may be already align if you use smartphone. Thanks.
10th Apr 2018, 12:07 PM
Warith Vatanaplachaigoon
Warith Vatanaplachaigoon - avatar
+ 5
Olga Only horizontally.
10th Apr 2018, 10:18 PM
Warith Vatanaplachaigoon
Warith Vatanaplachaigoon - avatar
+ 5
Wow! It’s work! Thanks for your help @Olga
10th Apr 2018, 10:56 PM
Warith Vatanaplachaigoon
Warith Vatanaplachaigoon - avatar
+ 3
Need to see the code
10th Apr 2018, 11:08 AM
Olga
+ 3
Warith Vatanaplachaigoon Please tell me you want to position only horizontally in the middle or in the center of the screen of the device
10th Apr 2018, 4:18 PM
Olga
+ 3
And can be simply svg { display: block; margin: 0 auto;}
10th Apr 2018, 10:42 PM
Olga
+ 3
Warith Vatanaplachaigoon Height is necessary for the location in the center of the entire screen. Only for horizontal positioning, height is not needed. It is better to erase. Sorry. Another option will also work. Thank you for the opportunity to solve a lovely exercise.
11th Apr 2018, 6:29 AM
Olga
+ 2
svg { display: block; margin: 10px auto; }
10th Apr 2018, 1:32 PM
CalviŐ˛
CalviŐ˛ - avatar