对于 wordpress 的 ACF(高级自定义字段)插件,在其所见即所得的编辑器字段中,我希望能够更改大图像属性的默认图像大小以使其响应而不是将其设置为定义的高度和宽度(以像素为单位)。有没有办法调整这个?是用css还是调整ACF的核心文件?基本上我希望包装我的图像的 html 代码符合
<img src"url/path/to/image" width="100%" height="auto">
代替
<img src"url/path/to/image" width="1024px" height="576px">
最佳答案
这是我用来使 WordPress 所见即所得图像响应的 CSS:
.entry-content img, .comment-content img, .widget img, .entry-summary img, .wp-caption { max-width: 100%; }
img[class*="align"], img[class*="wp-image-"], .comment-content img[height], .entry-content img, .entry-summary img, img[class*="attachment-"] { height: auto; }
img.size-full, img.size-large, .wp-post-image, .post-thumbnail img { max-width: 100%; height: auto; }
关于html - 如何在wordpress的ACF插件中调整 'large'图片大小的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29540371/