css - 更改目录图像大小 magento

标签 css image magento categories catalog

我正在尝试更改目录图片的大小。我更改了 css,还使用了调整大小功能

<?php 
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(196); ?>" width="135" height="296" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
</a>

但是没有用。似乎我的模板具有声明的类别图像的属性。在代码中,类别产品应用了尺寸:245x245。我一直在到处寻找改变它,但没有任何效果。我看到 magento go 允许您在后端覆盖任何目录图像的默认大小和比例。但我在社区中看不到同样的东西..

最佳答案

图片的物理大小会改变,但是因为图片的宽高是用html设置的,所以不会改变。

改变

src="helper('catalog/image')->init($_product, 'small_image')->resize(196); ?>" width="135" height="296"

src="helper('catalog/image')->init($_product, 'small_image')->resize(196); ?>" width="196" height="196"

关于css - 更改目录图像大小 magento,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15604257/

相关文章:

asp.net - FCK编辑器。处理图像

python - 为给定的索引 python 插值图像

html - IE8 忽略 CSS 样式

html - 悬停时布局更改

html - 在这种情况下如何制作 css Sprite ?

magento - Stripe Payment - 卸载噩梦

Magento - 如何在管理面板的产品信息下添加自定义选项卡?

JavaScript:在 div.container < window.height 时做一些事情

相对于图像的 HTML/CSS 文本

magento - 社区版上的 CM Redis session 后端缓存