将 svg 与屏幕中心对齐 [英] Align svg to center of screen

查看:21
本文介绍了将 svg 与屏幕中心对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 svg

<svg id="svgMain" align="center" width="500" height="500"></svg> 

但是它没有与中心对齐.如何将其与屏幕中心对齐.

But its not aligned to the center.How to align it to the center of the screen.

推荐答案

尝试 CSS:

#svgMain {margin-left:auto; margin-right:auto; display:block;}

这篇关于将 svg 与屏幕中心对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆