如题所述
因为svg是编码图片,所以你需要规定其大小,用CSS的背景需要加上:
.. {background: url(*.svg) no-repeat;
background-size: 100% 100%;/* 高度 宽度 */
}
用HTML的<img>标签需要加上两个属性height=""和width=""(单位px,不需要加,不能改单位)
温馨提示:答案为网友推荐,仅供参考
第1个回答 2019-01-02
.class名{
background: url(*.svg) no-repeat fixed;
}
background: url(*.svg) no-repeat fixed;
}
就是用fixed来铺满整个网页做背景图片;
no-repeat是表示不重复平铺;