css怎么实现英文不换行


本文摘自PHP中文网,作者藏色散人,侵删。

css实现英文不换行的方法:首先创建一个HTML示例文件;然后在body中定义一些英文内容;最后通过添加“white-space:nowrap;”属性实现英文不换行效果。

本文操作环境:windows7系统、HTML5&&CSS3版、Dell G3电脑。

CSS强制英文、中文换行与不换行

设计制作HTML时会遇到CSS强制英文、中文换行与不换行的问题,可以通过本文了解一下相关知识。

结构:

1.Transshipment Booking System is launched只对英文起作用,以字母作为换行依据

2.Transshipment Booking System is launched只对英文起作用,以单词作为换行依据

3.Transshipment Booking System is launched只对中文起作用,强制换行

4.Transshipment Booking System is launched强制不换行,都起作用

5.不换行,超出部分隐藏且以省略号形式出现

5.不换行,超出部分隐藏且以省略号形式出现Transshipment Booking System is launched

代码:

.p1{ word-break:break-all; width:150px;}/*只对英文起作用,以字母作为换行依据*/

.p2{ word-wrap:break-word; width:150px;}/*--只对英文起作用,以单词作为换行依据*/

.p3{white-space:pre-wrap; width:150px;}/*只对中文起作用,强制换行*/

.p4{white-space:nowrap; width:10px;}/*强制不换行,都起作用*/

.p5{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100px;}//*不换行,超出部分隐藏且以省略号形式出现*/

1. word-break:break-all;只对英文起作用,以字母作为换行依据

阅读剩余部分

相关阅读 >>

css如何修改滚动条箭头样式

html代码如何让照片变模糊

css如何实现字体长阴影效果

css top不起作用怎么办

css字体乱码怎么办

css的min-height属性怎么用

css text-transform属性怎么用

css left属性怎么用

vue中如何集成css框架?方法介绍

css text-wrap属性怎么用

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...