如何在Firefox上使用连字符启用换行符 [英] How to enable line break at hyphens on Firefox

查看:120
本文介绍了如何在Firefox上使用连字符启用换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Chrome,IE和Safari以连字符分隔线,但Firefox不支持。

Chrome, IE, and Safari break lines at hyphens but Firefox doesn't.

有什么方法可以使Firefox以连字符断开线,像其他浏览器?

Is there any way to make Firefox break lines at hyphens, like other browsers?

推荐答案

在连字符后面插入< wbr> 标记。 此标记不存在于任何HTML规范中(但是它在HTML5草稿中),但它已经在浏览器中工作了很长时间。

Insert the <wbr> tag after the hyphen. This tag is not present in any HTML specification (yet—it is in HTML5 drafts), but it has worked for a long time in browsers.

当连字符周围有足够多的字符时,Firefox会自动将连字符视为允许换行符。但是如果你希望允许换行比这更广泛,使用< wbr> ,例如。 pre< wbr> war

Firefox automatically treats a hyphen as allowing a line break after it when there are sufficiently many characters around the hyphen. But if you wish to allow line breaks more widely than that, use <wbr>, e.g. pre-<wbr>war.

这篇关于如何在Firefox上使用连字符启用换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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