Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

Simple Flex and grid layout in Tailwind

I'm trying to create a layout that is 2/3 wide on the left, and 1/3 wide on the right at md: and larger sizes. Smaller than that, I would like the two to be on top of each other.

When I do this, the flex works at smaller sizes, but my containers are not the size I anticipated:

<div class="flex flex-wrap md:flex-wrap-reverse">
<div class="col-span-8 ...">

...

</div>
<div class="col-span-4 ...">

...

</div>
</div>
question from:https://stackoverflow.com/questions/65929755/simple-flex-and-grid-layout-in-tailwind

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Thanks to @KeithNicholas I found my answer - I changed a prior attempt to this:

<div class="grid md:grid-flow-col ">
<div class="col-span-8 ...">

...

</div>
<div class="col-span-4 ...">

...

</div>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...