目的是拥有2个不同的电子邮件布局 - 一个用于移动设备,一个用于桌面。桌面版本具有2列,在移动版本中,内容应崩溃为1列(如,移动视图)。重要的是,如果块是不同的高度,则左侧边框对它们俩的高度相同。
尽可能少的代码重复代码重复,否则电子邮件的大小太大也很重要。
The goal is to have 2 diferrent email layouts - one for mobile and one for desktop. The desktop version has 2 columns and in the mobile version the content should collapse to only 1 column (like in pictures below desktop view, mobile view). It’s important that if the blocks are different heights the border on the left is the same height for both of them.
It’s also important to have as little code duplication between the mobile and desktop views as possible otherwise the email size would be too large.
发布评论
评论(1)
您可以使用Flexbox。
将
最小宽度
设置为卡片,并设置显示:flex
到包含的父。并设置flex-wrap:wrap
示例:
codepen
PS:忽略codepen中的JS部分
You can use flexbox.
set
min-width
to the cards and setdisplay: flex
to parent contained. and setflex-wrap: wrap
Example:
Codepen
PS: Ignore JS Part in the Codepen