首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在顺风css中实现两个网格响应布局

如何在顺风css中实现两个网格响应布局
EN

Stack Overflow用户
提问于 2022-09-05 05:15:53
回答 1查看 297关注 0票数 0

我正在尝试做一个两列响应的布局与顺风CSS,其中第一列将占70%,这两列将成为全宽度的移动。我试过了以下几点,但似乎我实际上错过了一些东西,结果并不是我想要的。拜托,我需要有人帮忙。

代码语言:javascript
复制
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.2/tailwind.min.css" />

<div class="grid grid-cols-5 md:grid-cols-1 lg:grid-cols-2 gap-3">
    <div class="col-span-4 flex justify-center text-6xl border-2 border-gray-300 rounded-xl p-6 bg-gray-100">2</div>
    <div class="flex justify-center text-6xl border-2 border-gray-300 rounded-xl p-6 bg-gray-100">4</div>
  </div>

EN

回答 1

Stack Overflow用户

发布于 2022-09-05 11:43:07

您可以为父div使用网格流行sm :grid-flow- class,为class 4类设置sm,请参见下面的示例。

代码语言:javascript
复制
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.2/tailwind.min.css" />

<div class="grid grid-flow-row sm:grid-flow-col gap-3">
<div class="sm:col-span-4 flex justify-center text-6xl border-2 border-gray-300 rounded-xl p-6 bg-gray-100">2</div>
<div class="flex justify-center text-6xl border-2 border-gray-300 rounded-xl p-6 bg-gray-100">4</div>
  </div>

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73604757

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档