The issue is likely the use of the container
class, not the fixed
class.
In TailwindCSS, container
is used for constraining an elements width to the width of the current breakpoint.
https://tailwindcss.com/docs/container
So let's say your screen is currently 1200px wide. The container will always be 1024px wide—even if you set w-full
. Because the max width in the large breakpoint is 1024px.
When you update the size to max-w-full
, you're essentially removing this constraint on the size, letting the nav
span the full width of the screen. Adding the max-w-full
class cancels out the container
class. So you can actually get the same result if you remove both the container
and max-w-full
classes.
I managed to solve it by modifying class w-full to max-w-full, although I'm not sure exactly why it made so much of a difference
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.