【发布时间】:2017-04-28 10:10:06
【问题描述】:
对于相对简单的响应式布局问题,我很难找到一个好的解决方案。
这是一个产品项组件,应该类似于 example。
它带来了某种等高要求(在桌面图像上对其他内容,在移动图像上对产品信息)。
单独来看,这不会是一个问题,但我很难为两个不同的视口找到一个没有重复内容/标记的好做法。
主要问题是包装/流动行为。通常我会在信息和细节周围放置一个包装器,但由于移动版本,这是不可能的。
也许可以给我一个很好的提示如何解决我的问题?
不胜感激
感谢和问候,eldaDev
.product-item {
display: flex;
flex-wrap: wrap;
border: 1px solid #333;
}
.product-item__image {
width: 25%;
background-color: #ccc;
}
.product-item__info {
width: 75%;
background-color: green;
}
.product-item__detail {
width: 100%;
background-color: blue;
}
<!-- Markup example mobile version alike -->
<div class="product-item">
<div class="product-item__image">img</div>
<div class="product-item__info">info content</div>
<div class="product-item__detail">detail content</div>
</div>
【问题讨论】:
标签: html css responsive-design