中心SVG图像在背景中

时间:2015-10-24 01:17:02

标签: html css svg

我遇到了在背景中居中SVG图像的问题。

这是CCS:

.cs-title {
  display: block;
  background: url("../logo.svg");
  background-repeat: no-repeat;
  height: 220px;
  margin: 0 auto;
  text-indent: -9999px;
  width: 440px;  
  background-position:left center;
  float: center;
}

你们有什么想法吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

对于徽标,我会将svg放在页面上而不是背景图像上。另外,没有更多信息,我猜测问题就在于svg本身。您是否在svg代码中将viewbox propety设置为svg维度,以及将高度和宽度设置为100%?