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

WBOY
Release: 2016-06-01 09:53:25
Original
1554 people have browsed it

解决办法:

使用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>
Copy after login

在线运行

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template