怎样让英文自动换行且不断词
来源:互联网 发布:mysql dba 招聘 编辑:程序博客网 时间:2024/06/10 08:26
想让英文自动换行且不断词,就得在换行处给英文单词加上换行连字符"-",这样才能符合印刷规范。
下面举个例子:
<style>body{background-color:black;color:#CCCCFF;text-align:center}</style>
<script>
function wrap(str,len){
return str.replace(new RegExp("(.{"+len+"})","igm"),"$1<br/>").replace(/(/w<br//>)(/w)/igm,'$1<font color=#00ff00>-<//font>$2');
}
document.write(wrap(new Array(30).join("Everything has an beginning has an end..."),50));
</script>
或采用英文字段两端对齐的方法,这样两边切齐,比较规矩:
英文对齐:<br>
<div style="font-size:12px;width:300;text-align:justify;text-justify:inter-ideograph">¨Crepower¨ Brand Belts, Chains and other Transmission Parts are manufactured under ISO9001 certified quality-control system. With improved quality material and well-organized production procedures, ¨Crepower¨ power transmission products have noticeably fatigue strength and long-service life.We can supply all types and sizes according to the related standards and customers’ requirements and</div>
<br>
.content {
position: absolute; left: 355px; top: 50px; width: 219px; height:250px;
line-height:150%;text-align:justify;text-justify:inter-ideograph;
/* 注意:设置两端对齐不能强制换行 否则不起作用 即不能加入word-break : break-all;*/
另外强制不换行的代码是white-space:nowrap;
.contenttitle {
position: absolute; left: 355px; top: 20px; width: 219px; height:30px;
line-height:150%;font-size:13px; font-weight:bold; color:#FF3201;
vertical-align:middle;white-space:nowrap; overflow:hidden;
/*强制不换行 zdz的作品,流风的作品*/
}
}
- 怎样让英文自动换行且不断词
- 英文自动换行怎样解决?
- 使用css让英文文本自动换行
- 让英文字符串超出表格宽度自动换行
- 英文自动换行
- 中文换行不断词
- 音乐自动播放且不断循环
- 一个html元素内有多个html元素,让子元素并排自动换行居中,且有间距
- 英文字符串自动换行解决方法
- 超长英文字符串自动换行
- JtextPanel实现英文自动换行
- div自动英文换行样式
- TextView英文自动换行解决方法
- 让pre自动换行
- 让QLabel自动换行
- RadioGroup 自动换行且保留点击事件
- 让编辑框自动换行
- 如何让表格自动换行
- 最大文件描述符限制对高性能Web架构的影响
- 对照http://en.wikipedia.org/wiki/UTF-7写了段转换代码
- ortp库API说明 1
- 经典C++库
- 梦想之地
- 怎样让英文自动换行且不断词
- linux 解压rar
- C/C++语言struct深层探索
- 通信中间件ICE(Internet Communications Engine)
- 解决office 带来的CPU使用率过高
- mybatis插入操作时获取主键
- Flex 调试版本下载,解决会话超时,调试错误等等问题!
- Android 2.3 Gingerbreader 正式发布,向游戏开发者献媚
- native2ascii的使用