如何在破折号上休息? [英] How to word-break on a dash?

查看:111
本文介绍了如何在破折号上休息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个相对简单的CSS:



  div {width:150px; }  

 < div& 12333-2333-233-23339392-332332323< / div>  



如何使字符串保持约束在 150 width ,并且简单地换行到连字符的换行符?

解决方案

以下列替换连字符:

   

它被称为软连字符。



  div {width:150px;}  

 < div> 12333& shy; 2333& shy; 233& shy; 23339392& shy; 332332323< / div>  

b

Given a relatively simple CSS:

div {
  width: 150px;
}

<div>
  12333-2333-233-23339392-332332323
</div>

How do I make it so that the string stays constrained to the width of 150, and simply wraps to a newline on the hyphen?

解决方案

Replace your hyphens with this:

&shy;

It's called a "soft" hyphen.

div {
  width: 150px;
}

<div>
  12333&shy;2333&shy;233&shy;23339392&shy;332332323
</div>

这篇关于如何在破折号上休息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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