如何在 tailwind-css 中自定义容器宽度?

mor*_*aie 4 css tailwind-css

我不想要 2xl 的 tailwind CSS 容器宽度。我怎样才能改变它? 在此输入图像描述

我想删除其默认宽度 2xl 。我该怎么做?

Pic*_*ard 5

或者,如果您需要一些与“屏幕”配置不直接连接的自定义解决方案(如 JHeth 建议),您可以单独配置容器行为,如下所示:

module.exports= {
    theme: {
        container: {
            screens: {
                'sm': '100%',
                'md': '100%',
                'lg': '1024px',
                'xl': '1280px',
                '2xl': '1600px',
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)