Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的CSS:
#social #twitter { background-image: url("../img/twitter.svg"); max-height: 32px; max-width: 32px; }
我的 HTML 看起来像这样:
<div id="social"> <div id="twitter"></div> </div>
SVG 不会缩小到 32x32。SVG 为 512x512。有人可以帮助我吗?谢谢。
尝试添加
background-size: contain;
到 CSS。有关支持的浏览器和浏览器版本的详细信息和表格,请参阅MDN 文档。background-size
background-size