首页 > 解决方案 > Make text inside textarea not break to next line

问题描述

So I have a textarea and when you put too much next on one line, it overflows and goes onto the next line, without being on the next line.

This is normal but what if I want it to not go onto the next line and keep going, possibly with a scroll bar so you can scroll across to view the text

For example

text here flows onto
the next line

I want it to be

text here doesnt flow onto the next line, but might not be visible without scrolling

In a textarea

Is this possible? I've tried overflow-x but that doesn't seem to be working

标签: htmlcss

解决方案


white-space: nowrap;CSS 属性与overflow

https://developer.mozilla.org/en-US/docs/Web/CSS/white-space


推荐阅读