Home > database >  how to get div to scroll text horizontally when overflow instead of breaking into new line
how to get div to scroll text horizontally when overflow instead of breaking into new line

Time:07-28

This is common on mobile apps. There is a navbar of selectable text options. when they overflow horizontally, they do not break into a new line. instead you scroll horizontally to reach all options.

How can I achieve the above?

CodePudding user response:

You must set to your div

white-space: nowrap //To prevent word breaking
overflow: auto;// To appear scroll
  • Related