简体   繁体   English

Tailwind css - 如果有任何其他溢出正常覆盖剩余高度

[英]Tailwind css - cover remaining height if there is any else overflow like normal

I am working on a website and on some pages there are very few contents like login page and footer don't reach to bottom, That's why I want main section to cover remaining space if there is any and work like normal if overflow.我在一个网站上工作,在某些页面上很少有内容,如登录页面和页脚没有到达底部,这就是为什么我希望主要部分覆盖剩余空间(如果有的话)并且如果溢出则正常工作。 Basically I want it to work like min-height.基本上我希望它像最小高度一样工作。 I tried using min-height with 100vh and 100% but no desired result.我尝试使用 100vh 和 100% 的最小高度,但没有得到想要的结果。

You can use a custom min height.您可以使用自定义最小高度。

<div class="min-h-60">
    content...
</div>  

In our tailwind config file, you should extend minHeight:在我们的 tailwind 配置文件中,您应该扩展 minHeight:

module.exports = {
    purge: [],
    theme: {
        extend: {
            minHeight: {
                '60': '15rem'
            }
        }   
    },
    variants: {},
    plugins: []
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM