<分区>
<分区>
我尝试为一篇帖子的特色图片上传 svg 文件,但未能显示。以下是我在开发工具中看到的内容。
<img width="1" height="1" src=".../featured.svg" class="attachment-large wp-post-image" alt="featured" oldsrc=".../featured.svg">
它似乎为特色图像生成了 width="1"height="1"
。有什么办法可以更改默认设置吗?我更喜欢更改代码而不是使用 JavaScript 来删除属性。
最佳答案
您可以为每个帖子缩略图图片设置 100% 的高度和宽度:
n.e.g :
.post img {
height:100% !important; /* add !important */
width:100% !important; /* add !important */
}
关于html - 删除 Wordpress 中特色 svg img 的默认大小属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32133373/