html 标点符号 不换行,字母汉字可以换行 标点符号不能换行_html/css_WEB-ITnose

博客探讨了前端开发中遇到的标点符号换行问题,以及CSS样式的应用。通过分析`.chatBox`、`.chatPicLeft`、`.chatContentLeft`等类,展示了如何解决文本换行和布局对齐的挑战。同时提到了代码组织和规范,如`.textClass`使用`word-break`属性确保长单词正确换行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如图

部分代码如下:

alice.png

hello.你好呀!标点不会自动换行标点不会自动换行标点不会自动换行。。。。。。。。。。。。。。。。。。。。。。。。

alice.png

hello

12:30

alice.png

标点不会自动换行标点不会自动换行标点不会自动换行标点不会自动换行标点不会自动换行标点不会自动换行hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello

.chatBox{padding:1rem 1rem 0rem 1rem;position:relative;}.chatPicLeft{height:2.5rem;width:2.5rem;float:left;position:absolute;}.chatContentLeft{margin-left:3.5rem;margin-right:4.5rem;}.chatPicRight{height:2.5rem;width:2.5rem;right:1rem;float:right;}.chatContentRight{text-align:right;margin-left:4.5rem;margin-right:3.5rem;}.chatTime{text-align:center;}.input{position:fixed;bottom:0;z-index:9999;height:3rem;width:100%;background-color:gray;}.textClass{word-break:break-all;}.chatBoxLeft{display:inline-block;padding:0.5rem;background-color:#ffffff;-webkit-border-radius:0.3rem;-moz-border-radius:0.3rem;-o-border-radius:0.3rem;border-radius:0.3rem;}.chatBoxRight{display:inline-block;padding:0.5rem;background-color:#ffffff;-webkit-border-radius:0.3rem;-moz-border-radius:0.3rem;-o-border-radius:0.3rem;border-radius:0.3rem;}

回复讨论(解决方案)

.textClass{word-break: break-all;word-wrap: break-word;}

声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值