gpt4 book ai didi

tailwind-css - 如何将最大宽度设置为百分比或静态值

转载 作者:行者123 更新时间:2023-12-04 16:25:58 31 4
gpt4 key购买 nike

对于带有顺风的元素的宽度,您可以通过百分比或固定的 rem 值设置它。要设置 max-width,您只能将其设置为断点的大小。
为什么是这样?
有没有办法将 max-width 设置为百分比或不是断点的固定大小?

最佳答案

Is there any way to set max-width to a percentage or a fixed size thatisn't a breakpoint?


您需要 customize tailwind.config.js
  // tailwind.config.js
module.exports = {
theme: {
maxWidth: {
+ '1/4': '25%',
+ '1/2': '300px',
+ '3/4': '75%',
}
}
}
因此,您将最大宽度固定为百分比或像素。
enter image description here

Why is this?


您不受设置和功能的限制,相反,Tailwind CSS 为您提供了一个已在实践中证明自己的标准。
但是如果你需要对你的项目进行微调,你总是可以做到的。
享受使用 Tailwind CSS!

关于tailwind-css - 如何将最大宽度设置为百分比或静态值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64190671/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com