当前位置:编程学习 > html/css >>

css表格table中间pre自动换行的处理方法

/*pre强制换行*/
pre{ white-space: pre-wrap!important;    /*保留空白,进行换行*/
word-wrap: break-word!important;    /*连续字符换行*/
/*white-space:normal!important;*/    /*忽略空白,进行换行*/}

下面是pre强制换行的一个演示:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>css实现pre强制换行 - logo在线制作 http://www.zhaoxi.net/</title>
<style>
/*pre强制换行*/
pre{ border:#CCC solid 1px; padding:10px; background-color:#F9F9F9;
font-family:"Courier New", Courier, Arial; font-size:12px; line-height:1.75;
white-space: pre-wrap!important;    /*保留空白,进行换行*/
word-wrap: break-word!important;    /*连续字符换行*/
/*white-space:normal!important;*/    /*忽略空白,进行换行*/}
</style>
</head>
<body>
<div style="width:450px;">
    <pre>
    111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
    
    站长资源库为您提供-基于jquery特效,jquery弹出层效果,导航菜单代码,下拉菜单代码和jquery焦点图片代码,朝夕网专注于图片banner站标logo制作,WEB后台/手机/软件UI设、建站素材、html5和CSS3新技术等。
    </pre>
</div>
</body>
</html>
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,