Divide Style

Utilities for controlling the border style between elements.

Default class reference

Class
Properties
divide-solid > + border-style: solid;
divide-dashed > + border-style: dashed;
divide-dotted > + border-style: dotted;
divide-double > + border-style: double;
divide-none > + border-style: none;

Usage

Control the border style between elements using the divide-{style} utilities.

Divide Style - 图1

  1. <div class="divide-y-4 divide-yellow-600 divide-dashed">
  2. <div>1</div>
  3. <div>2</div>
  4. <div>3</div>
  5. </div>

Responsive

To control the border style between elements at a specific breakpoint, add a {screen}: prefix to any existing divide style utility. For example, use md:divide-dashed to apply the divide-dashed utility at only medium screen sizes and above.

  1. <div class="divide-y-2 divide-dashed md:divide-solid">
  2. <!-- ... -->
  3. </div>

For more information about Tailwind’s responsive design features, check out the Responsive Design documentation.

Customizing

Variants

By default, only responsive variants are generated for divide style utilities.

You can control which variants are generated for the divide style utilities by modifying the divideStyle property in the variants section of your tailwind.config.js file.

For example, this config will also generate hover and focus variants:

  1. // tailwind.config.js
  2. module.exports = {
  3. variants: {
  4. extend: {
  5. // ...
  6. + divideStyle: ['hover', 'focus'],
  7. }
  8. }
  9. }

Disabling

If you don’t plan to use the divide style utilities in your project, you can disable them entirely by setting the divideStyle property to false in the corePlugins section of your config file:

  1. // tailwind.config.js
  2. module.exports = {
  3. corePlugins: {
  4. // ...
  5. + divideStyle: false,
  6. }
  7. }

←Divide Opacity   Ring Width→