Home  >  Article  >  Web Front-end  >  css 实现长英文或链接自动换行

css 实现长英文或链接自动换行

WBOY
WBOYOriginal
2016-06-01 09:53:251550browse

解决办法:

使用CSS属性 word-wrap:break-word;即可解决。使用break-word时,是将强制换行。

break-word兼容各版本IE浏览器,兼容谷歌浏览器。

实例:

<code class="language-html"> 
 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<title>css 实现长英文或链接自动换行</title> 
<style> 
.box{ border:1px solid #00F; height:120px; width:200px;word-wrap:break-word} 
</style> 
 
 
<div class="box"> 
aabbfjdlkfldsjfldsjfldjfljdlafjldsjflkdjflkdsjfldfjdlj<br> 
  <a href="http://www.manongjc.com">http://sddsdsddddddddddddddddddddddddddddddddddddddddd.com</a>
</div> 
 
 </code>

在线运行

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn