Inconsistent spacing with space-y- class #18323
-
Inconsistent spacing with
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The spacing seems to be even in this Tailwind Play which would suggest it would be something particular to your project causing the unexpected behavior. Perhaps you have some extra CSS somewhere that applies margin to certain elements. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Ah, I see, thank you. This is because of the
my-2
on the<div>
. This effectively doubles the top spacing between "Text" and the<div>
, due tomargin-block-end
on the<p>
fromspace-y-2
and themargin-block
from themy-2
on the<div>
.I'm not sure what you are trying to achieve with the
my-2
on the<div>
but possible solutions to solve the inconsistent spacing: https://play.tailwindcss.com/cEswpu5pRq