css - 放大和缩小时从 div 溢出的文本

标签 css html zooming

我在 div 中有一个文本。当我调整页面的缩放级别时,div 内的文本移出 div。我要求文本保持原样在 div 中,而不调整 div 的宽度。

我的分区是:

    <div style="width: 463px; 
height: auto; 
min-height: 0px; 
overflow: visible; 
border: 3px dashed rgb(2, 158, 217); 
margin-left: 18px; 
max-width: 466px; 
color: rgb(0, 0, 0); 
font-size: 12px; 
font-family: arimo; 
font-weight: 400; 
font-style: normal; 
text-align: start;
 white-space: nowrap; 
line-height: 1.231;
padding-left: 3.5px;" wrap="off" name="nowrap" id="changedtext5" class="textdrag">asdksjadksja&nbsp;kldjaslkjd&nbsp;jasdiwie&nbsp;qowyruasdasd&nbsp;kajskjd&nbsp;kjaskldjlka;sdioewyriosudfrds</div>

最佳答案

overflow:visible; 允许文本脱离分隔线的范围。将此设置为 overflow:hidden; 将隐藏任何设法移出分隔线的文本。

我不知道这是否是您想要的解决方案,因为它最终会隐藏文本。

如果您希望它滚动,请使用 overflow-x:scroll;

关于css - 放大和缩小时从 div 溢出的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14974376/

相关文章:

javascript - 清理草率的代码 html/css/javascript

caching - 什么情况下浏览器会缓存<video>文件?

Javascript 在点击时添加类

CSS 媒体查询功能

html - 解码 windows-1252 和引用的可打印 HTML 的组合

android - 将矩阵图像定位在 ImageView 的中心

javascript - 如何禁用 D3.js 中的缩放功能?

javascript - 通过单击缩放按钮放大和缩小图像 (Javascript)

html - Bootstrap 中心内联输入,它们之间没有空格

html - CSS - 使用类的渐变 "border"