简体   繁体   中英

How can I prevent the navbar content from shifting to the left when I click on a certain page? (website linked below)

While clicking on any other page doesn't affect the navbar content, selecting the "important" page shifts all of the navbar text to the left. Website

it happens because the content is overflowing, so a scrollbar it will appear,

and since your container is 100% this will happen,

since the width, it will be something like this (100vw - scrollWidth)


the solution will be to add a width: 100vw; to all elements that need to be having all width of the device

since you didn't give the code, I can't modify and send you the solution code. (but I suppose it will be something like ul { width: 100vw; }

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM