admin管理员组文章数量:1025202
My card element has a fixed height of h-80
(in Tailwind). usually I use the card in a grid.
Now, I have a div inside that card, which is bigger than it's parent div, however I want it to scroll vertically. The problem bees now, that I can not scroll pletly down. The last line is cut off.
Overflow auto, but not pletly scrollable:
Full height to see what content is missing:
I am using VueJS as framework, this is my Card ponent:
<div class="w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
How do I fill the remaining space in a div with overflowing content in TailwindCSS?
My card element has a fixed height of h-80
(in Tailwind). usually I use the card in a grid.
Now, I have a div inside that card, which is bigger than it's parent div, however I want it to scroll vertically. The problem bees now, that I can not scroll pletly down. The last line is cut off.
Overflow auto, but not pletly scrollable:
Full height to see what content is missing:
I am using VueJS as framework, this is my Card ponent:
<div class="w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
How do I fill the remaining space in a div with overflowing content in TailwindCSS?
Share Improve this question asked Oct 15, 2021 at 23:06 Martin MüsliMartin Müsli 1,1693 gold badges16 silver badges32 bronze badges 1- Not an height issue as my brain told me seconds after I posted the question.... See the answer – Martin Müsli Commented Oct 15, 2021 at 23:13
1 Answer
Reset to default 3Use the flex-grow
property on the sub-div to allow it to grow.
Set flex
on the parent div and flex-col
to keep the styling.
Find the documentation here
<div class="flex flex-col w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="flex-grow h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
My card element has a fixed height of h-80
(in Tailwind). usually I use the card in a grid.
Now, I have a div inside that card, which is bigger than it's parent div, however I want it to scroll vertically. The problem bees now, that I can not scroll pletly down. The last line is cut off.
Overflow auto, but not pletly scrollable:
Full height to see what content is missing:
I am using VueJS as framework, this is my Card ponent:
<div class="w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
How do I fill the remaining space in a div with overflowing content in TailwindCSS?
My card element has a fixed height of h-80
(in Tailwind). usually I use the card in a grid.
Now, I have a div inside that card, which is bigger than it's parent div, however I want it to scroll vertically. The problem bees now, that I can not scroll pletly down. The last line is cut off.
Overflow auto, but not pletly scrollable:
Full height to see what content is missing:
I am using VueJS as framework, this is my Card ponent:
<div class="w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
How do I fill the remaining space in a div with overflowing content in TailwindCSS?
Share Improve this question asked Oct 15, 2021 at 23:06 Martin MüsliMartin Müsli 1,1693 gold badges16 silver badges32 bronze badges 1- Not an height issue as my brain told me seconds after I posted the question.... See the answer – Martin Müsli Commented Oct 15, 2021 at 23:13
1 Answer
Reset to default 3Use the flex-grow
property on the sub-div to allow it to grow.
Set flex
on the parent div and flex-col
to keep the styling.
Find the documentation here
<div class="flex flex-col w-full overflow-hidden h-full px-3 py-2">
<div v-if="title" class="block text-gray-700 text-lg font-semibold py-2 px-2">
<i :class="title_icon" />
{{ title }}
</div>
<div class="flex-grow h-full overflow-y-auto">
<slot>
<-- Here is another ponent which holds the appointments-->
</slot>
</div>
</div>
本文标签: javascriptHow to fix in Tailwindcss div height overflows parent divStack Overflow
版权声明:本文标题:javascript - How to fix in Tailwindcss div height overflows parent div - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618883a2159455.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论