0

如何在 Mozilla Firefox 中防止 URL 中的换行符。使用 CSS white-space: nowrap; ? 还有其他解决方案吗?谢谢。

http://codepen.io/anon/pen/VeNJKW

.container {
  width:  275px;
  padding: 10px;
  border: 1px solid black;
}

.nowrap {
  white-space: nowrap;
}
<div class="container"> 
  This is a URL: <span class = "">http://www.google.com/helloworld</span>
</div>

4

2 回答 2

1

nowrap 样式未在您的代码中应用,应该是:

This is a URL: <span class = "">http://www.google.com/helloworld</span>

->

This is a URL: <span class = "nowrap">http://www.google.com/helloworld</span>
于 2016-02-18T12:20:57.997 回答
0

你的意思是这样的吗?

.container {
  width:  275px;
  padding: 10px;
  border: 1px solid black;
  overflow: visible;

  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.nowrap {
  white-space: nowrap;
}

http://codepen.io/sheldonled/pen/eJoqWR

于 2016-02-18T12:21:31.283 回答