如何让文字变得更小以保持一行? [英] How can I make text get smaller in order to stay on one line?

查看:78
本文介绍了如何让文字变得更小以保持一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户填写一个字段时,我有一个< td> 获取文本填充。如果用户输入的文字比我的200px宽,它会缠绕并弄乱我的设计。有没有办法让文本变得更小,以适应一行而不是缠绕?

解决方案

字符串的最大长度,如果超过限制,只需剪切文本并添加...
文本。将标题放在标签中,以便在鼠标悬停时可以完整阅读。


例如:blabla bla
bla bla ...

只是简单的可视文字,并使用标题

I have a <td> the gets populated with text when a user fills out a field. If the text the user enters is bigger than my 200px wide , it wraps around and messes up my design. Is there a way to make the text get smaller in order to fit on one line instead of wrapping around?

解决方案

better you set maximum length of string, if it over the limit, just cut the text and add "... " text . place title in tag , so it can read completly when mouse over .

example : blabla bla bla bla ...

just short in visual text, and use title

这篇关于如何让文字变得更小以保持一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆