Border Radius

    Rounded corners

    Use utilities like , .rounded, or .rounded-lg to apply different border radius sizes to an element.

    Use the rounded-full utility to create pills and circles.

    Border Radius - 图2

    1. <div class="rounded-full h-24 w-24 flex items-center justify-center...">Circle</div>

    No rounding

    Use rounded-none to remove an existing border radius from an element.

    This is most commonly used to remove a border radius that was applied at a smaller breakpoint.

    1. <div class="rounded-none ...">.rounded-none</div>

    Use rounded-{t|r|b|l}{-size?} to only round one side of an element.

    Rounding corners separately

    Use rounded-{tl|tr|br|bl}{-size?} to only round one corner an element.

    Border Radius - 图5

    1. <div class="rounded-tl-lg ..."></div>
    2. <div class="rounded-tr-lg ..."></div>
    3. <div class="rounded-br-lg ..."></div>
    4. <div class="rounded-bl-lg ..."></div>

    To control the border radius of an element at a specific breakpoint, add a prefix to any existing border radius utility. For example, use md:rounded-lg to apply the rounded-lg utility at only medium screen sizes and above.

    1. <div class="rounded md:rounded-lg ...">
    2. <!-- ... -->
    3. </div>

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

    Customizing

    By default, only responsive variants are generated for border radius utilities.

    You can control which variants are generated for the border radius utilities by modifying the borderRadius 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. extend: {
    4. + borderRadius: ['hover', 'focus'],
    5. }
    6. }
    7. }

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

    1. // tailwind.config.js
    2. module.exports = {
    3. corePlugins: {
    4. // ...
    5. + borderRadius: false,

     Border Width→