Screen Visualisation:
HTML code :
<nav class="item-center flex items-center"> <div class="bg-red-100 pl-5 py-1"> <a href="#"><img src="img/logo.svg" alt="Logo"></a> </div> <div class="flex-1"> <ul class="hidden sm:flex bg-blue-200 justify-end gap-12 text-red-500 uppercase text-s pr-5"> <li class="cursor-pointer ">Features </li> <li class="cursor-pointer ">Products </li> <li class="cursor-pointer ">Services </li> <li class="cursor-pointer ">About us </li> <li class="cursor-pointer ">Contact </li> </ul> </div> </nav>
I'd use whitespace-nowrap
class for about us section and first thing that comes to my mind for logo is to add a minimum width to it, and flex grow , so that it can't go below certain width and once the menu disappears that it grows to the full width.
About wrapping
<li class="cursor-pointer whitespace-nowrap">About us </li>
and about small screen check https://tailwindcss.com/docs/responsive-design#targeting-a-single-breakpoint and
<div class="flex bg-red-100 pl-5 py-1 sm:pl-0 sm:w-full sm:justify-center">
<a href="#"><img src="img/logo.svg" alt="Logo"></a>
</div>
I try to resolve your problem, check here
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.