html - 如何在wordpress的ACF插件中调整 'large'图片大小的属性

标签 html css wordpress advanced-custom-fields

对于 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/

相关文章:

Javascript:onClick 复选框更改 div 颜色

html - 在图像上水平和垂直居中文本框

javascript - onFocus 不适用于 javascript 函数

jquery - fancybox scroll 在 iPad 上不显示,在浏览器中显示

javascript - JSON Api 调用 "POST"

css - Elementor 更改按钮悬停在列上的部分图像

html - CSS:任何内容的第一个单词后换行

html - 使用显示 :table-cell; 时无法居中导航栏

html - CSS:为什么不能使用img:hover显示下拉菜单

wordpress - 如何使用 get_avatar 并强制使用 HTTPS?