How to center this div?

I am using tailwind css. The "Sign in" text has "text-center" property I want the above component in centre too. How to do that?
5 Replies
Somnath Golui
Somnath GoluiOP2y ago
Just below blogs.
Jochem
Jochem2y ago
Share some code, without it's going to be very hard to help. Preferably codepen or tailwinds playground
Chris Bolson
Chris Bolson2y ago
as @jochemm says, without code it is almost impossible to give you a concise solution as it rather depends on how you have styled your top component. For example, if you have used grid you could use grid-cols-[1fr_2fr_1fr] (which would translate to grid-template-columns: 1fr 2fr 1fr;) to make the "logo" and "sign in" button take up an equal amount of space either side and then just ensure that your nav is centered in the middle column.
Azyrum
Azyrum2y ago
Flex, flex is always the answer 🙏
Jochem
Jochem2y ago
Learn grid, Azyrum 😛 There's so many things that are much easier with grid than with flex
Want results from more Discord servers?
Add your server