Open In App
Related Articles

Tailwind CSS Spacing Complete Reference

Improve Article
Improve
Save Article
Save
Like Article
Like

Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the buildings blocks that you need. Tailwind CSS Spacing utilities manage and control the elements of padding, element’s margin, and space between child elements.

Tailwind CSS Class

Description

Example

PaddingIt creates space around the element, inside any defined border.
MarginIt creates space around the element, outside any defined border.
Space BetweenIt is used for controlling the space between child elements.

Below example will give you a brief idea about the Spacing of Tailwind CSS:

Example:

HTML




<!DOCTYPE html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
          rel="stylesheet">
</head>
  
<body class="text-center">
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1>
    <b>Tailwind CSS Space Between Class</b>
    <div class="mx-4 space-y-4">
        <div class="bg-green-400 h-16 rounded-lg
                    border-2 border-green-800">1</div>
        <div class="bg-green-400 h-16 rounded-lg
                    border-2 border-green-800">2</div>
        <div class="bg-green-400 h-16 rounded-lg
                    border-2 border-green-800">3</div>
        <div class="bg-green-400 h-16 rounded-lg
                    border-2 border-green-800">4</div>
    </div>
</body>
  
</html>

Output:

Tailwind CSS Spacing

Tailwind CSS Spacing 


Last Updated : 03 Aug, 2023
Like Article
Save Article
Similar Reads
Related Tutorials