I attempted to customize the margin of a div
element at specific screen sizes by using a {screen}: prefix
, but it did not have the desired effect. Here is what I tried:
<div className={'flex justify-center'}>
<div className={'w-full my-8 sm:my-20 md:my-48'}>
<div {...props}>
{children}
</div>
</div>
</div>
Upon inspecting, I noticed that only the my-8
class seemed to be working correctly.
All classes from Tailwind, including flex
for responsiveness, function as expected. However, the responsive margin (padding) does not seem to apply. My project utilizes Next.js and Tailwind CSS.