How to center the logo both on landing and home page, tailwind
I am trying to centre my logo on my landing page.
In the first photo there is the landing page, while in the second is the home page when the user logs in.
I managed to centre my logo on the home page since it is between two elements: the menu button and login button, while in my landing page there is no login button and that is why it is moved toward right more.
How can I centre it both on the landing and home page?
Use grid and grid-cols-3 as the container classes (rather than flex and flex-row). The children will fill the width of the parent, so no w- utilities are required on the children.
<div class="grid grid-cols-3 h-24">
<div class=""><!-- MENU --></div>
<div class=""><!-- LOGO --></div>
<div class="">
<div class="hidden sm:flex sm:items-center pr-3 w-1/4 justify-end" v-if="$page.props.user">
<!-- all markup for auth user menu -->
</div>
</div>
</div>
Inside the last child div; you can conditionally render the authenticated user menu
It looks like you have a container somewhere that is constraining the width of the nav, or one of its children? How have you incorporated the grid like I described above?
@TikTina my sample code was hardly "feature complete", you were expected to extrapolate!!!
You need the container and mx-auto classes to set the width and margins around the first div under the nav element. This element should also get grid and grid-cols-3.
Finally, the alignment within the three children should be left, center, and right respectively; left is default, so nothing needed. For the others, this can be achieved using flex along with justify-center and justify-end respectively. This will involve moving some of the classes up to the grid item (child) div