Reputation: 404
I'm currently trying tailwindcss along with Vite and recently something is being super annoying and couldn't find a solution yet.
Looks like tailwind automatically centers the content and I'm struggling on working with flex components due to this.
This is a code piece from what I'm using, it's very simple but you can see that the content is being centered from default and can't change that behavior yet D:
export const Home = () => {
return (
<div>
Wow
</div>
);
};
This is what it looks like
And if I try to use a combination of flex components it looks like this:
Upvotes: 1
Views: 251
Reputation: 11
Tailwind
doesn't automatically center content, but it might be from vite's default styling in the style.css
file. Be sure to check the boilerplate styling in the style.css
file.
Upvotes: 1
Reputation: 24940
Tailwind-css
doesn't center the element by default
.
I suspect this is being observed , because the parent of Home()
component has a flex property which is center, so divs of Home()
component is taking the center of the screen
Or
Maybe Vite
in the boilerplate, Check the boilerplate once, as Vite
boilerplate usually centers the div
elements
Upvotes: 1