【发布时间】:2022-01-17 22:12:33
【问题描述】:
我有一个 div,如果内容默认水平溢出。我怎样才能让它垂直滚动。这是我的html(我正在使用tailwind)
<section class="flex flex-col lg:flex-row">
<div class="w-full sm:w-3/4 lg:w-3/5 py-20 flex flex-col gap-y-10 items-center justify-center px-10">
<div class="flex items-center justify-between w-full">
<img src="https://img.icons8.com/ios/35/000000/add--v2.png" class="cursor-pointer mr-4" />
<input type="text" name="title" placeholder="Title" class="flex-1 border-0 outline-none placeholder-gray-600 text-4xl">
</div>
<textarea name="article" rows="10" placeholder="Tell your story..." class="flex-1 border-0 outline-none placeholder-gray-600 text-2xl w-full h-auto" id="input-html"></textarea>
</div>
<div class="w-full sm:w-1/4 lg:w-2/5 border-l-4 border-gray-400 p-5 overflow-y-scroll" id="output-html"></div>
问题是第二个 div 只是*水平滚动。而不是垂直的。
如何垂直做?
【问题讨论】:
标签: css flexbox overflow tailwind-css