【问题标题】:Stack items when mobile with Magento 1.9 and RWD theme使用 Magento 1.9 和 RWD 主题移动时堆叠项目
【发布时间】:2015-07-14 12:18:08
【问题描述】:

我刚刚发现了很多帖子,但没有一个给出明确的答案:当用户是桌面用户时如何连续显示 3 个项目并在移动设备中垂直堆叠它们?

我看到这是可能的,无需对产品网格进行黑客攻击(但产品按行显示两个),也许我可以使用类似的东西来获得相同的结果。

我创建了这个示例,它能够在桌面上显示 3 个项目,并在一行中显示 2 个,在另一个中显示 1 个。这接近我想要的:

<ul class="products-grid products-grid--max-4-col first last odd">
<li><img alt="" src="http://192.241.128.153/media/wysiwyg/index/pencil.jpg" />
<div class="product-info" style="min-height: 167px;">
<h2>Assine</h2>
</div>
</li>
<li><img alt="" src="http://192.241.128.153/media/wysiwyg/index/pencil.jpg" />
<div class="product-info" style="min-height: 167px;">
<h2>Vote</h2>
</div>
</li>
<li><img alt="" src="http://192.241.128.153/media/wysiwyg/index/pencil.jpg" />
<div class="product-info" style="min-height: 148px;">
<h2>Receba</h2>
</div>
</li>
</ul>

谢谢!

【问题讨论】:

    标签: magento magento-1.9 magento-1.9.1


    【解决方案1】:

    您可以使用 CSS 中的媒体查询来实现这一点,例如..

     @media only screen and (max-width: 770px) {
          .products-grid li {
               width: 100%;
          }
     }
    

    不要忘记产品列表版本。

    【讨论】:

    • 你好@womblegold,很抱歉这么新手,但你能否发布一个完整的 html 示例来说明你的建议? :D
    • 嗨,这不会出现在您的 HTML 中,它会出现在您的自定义 CSS 样式表中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多