Flex |
您所在的位置:网站首页 › doyouwanttoplay翻译 › Flex |
Flexbox & Grid FlexUtilities for controlling how flex items both grow and shrink. Quick referenceClassPropertiesflex-1flex: 1 1 0%; flex-autoflex: 1 1 auto; flex-initialflex: 0 1 auto; flex-noneflex: none; Basic usage InitialUse flex-initial to allow a flex item to shrink but not grow, taking into account its initial size: 01 02 03 01 02 03 Flex 1Use flex-1 to allow a flex item to grow and shrink as needed, ignoring its initial size: 01 02 03 01 02 03 AutoUse flex-auto to allow a flex item to grow and shrink, taking into account its initial size: 01 02 03 01 02 03 NoneUse flex-none to prevent a flex item from growing or shrinking: 01 02 03 01 02 03 Applying conditionally Hover, focus, and other statesTailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:flex-1 to only apply the flex-1 utility on hover. For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation. Breakpoints and media queriesYou can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:flex-1 to apply the flex-1 utility at only medium screen sizes and above. To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers. Using custom values Customizing your themeBy default, Tailwind provides four flex utilities. You can customize these values by editing theme.flex or theme.extend.flex in your tailwind.config.js file. tailwind.config.jsmodule.exports = { theme: { extend: { flex: { '2': '2 2 0%' } } } }Learn more about customizing the default theme in the theme customization documentation. Arbitrary valuesIf you need to use a one-off flex value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value. Learn more about arbitrary value support in the arbitrary values documentation. Flex WrapFlex GrowCopyright © 2023 Tailwind Labs Inc. Trademark Policy Edit this page on GitHubOn this pageQuick referenceBasic usageInitialFlex 1AutoNoneApplying conditionallyHover, focus, and other statesBreakpoints and media queriesUsing custom valuesCustomizing your themeArbitrary valuesFrom the creators of Tailwind CSS Make your ideas look awesome, without relying on a designer. “This is the survival kit I wish I had when I started building apps.”Derrick Reimer, SavvyCal |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |