css中英文左右与两端对齐

发布时间:2020-11-02编辑:脚本学堂
本文介绍了css实现中英文左右对齐与两端对齐的方法,有关css文字两端对齐的例子,css两端对齐如何实现,有需要的朋友参考下。

本节内容:
css实现中英文左右对齐或文字两端对齐
 

复制代码 代码示例:

<p>两端对齐</p>
英文对齐>
<div style="font-size:12px;width:300;text-align:justify;text-justify:newspaper">¨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>
中文对齐:<br>
<div style="font-size:12px;width:300;text-align:justify; text-justify:inter-ideograph">
上周五突然决定去鄱阳湖看鸟了,晚上没票,只好买了周六晚上的,没有拍鸟必用的专业相机与超长焦的镜头,甚至也没有一个望远镜,就匆匆出发了。今天上午九点走出南昌火车站,坐上一辆上中巴到永修县城,再挤进一个小面包,终于在中午到达了这个鄱阳湖畔的小镇——吴城。除了从附近两个城市南昌和九江来的游客,恐怕再没有远地方来的游人了,更别说背包客,到了晚上,竟只剩我一个外地人。在小面包上碰到的三个九江外国语学校的老师,一路同行也仅止于在镇子里匆忙逛一下就回去了。</div>
 
英文对齐:<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>
中文对齐:<br>
<div style="font-size:12px;width:300;text-align:justify; text-justify:inter-ideograph">
中央电视台广告部“防非典病疫,倡文明新风”公益flash征集

“非典”不仅是一种疾病,它还凸显了国人许多陋习,如随地吐痰、乱扔垃圾等。为倡导文明新风,中央电视台广告部在网上开展“防非典病疫,倡文明新风”公益flash征集赛。内容围绕提倡讲究卫生、保护环境、强身健体,提倡分餐、关爱他人、关心社会等新风气,批评国人在卫生等方面的陋习(大家也可自定主题)。表现形式要生动活泼,避免简单说教,要积极向上,让大家乐于接受,动画时长限一分钟以内。在创作时一定要考虑到在电视中播出的包括口径、技术指标在内的各项要求。比赛的部分得奖作品将在中央电视台公益广告时段播出。

本次活动设奖项如下:
一等奖1名,奖励现金6000元整;
二等奖2名,各奖励现金4000元整;
征集截止日期为6月10日,应征者请将联络信息发至ad@mail.cctv.com,欢迎参与。
(与此同时,相关主题的电视公益广告的制作正在展开,欢迎网友提供线索及建议。)
</div>
 

语法:
text-justify : auto | distribute | distribute-all-lines | distribute-center-last | inter-cluster | inter-ideograph | inter-word | kashida | newspaper
取值:
auto : 默认值。允许浏览器代理用户确定使用的两端对齐法则
distribute : 处理空格很像 newspaper ,适用于东亚文档。尤其是泰文
distribute-all-lines : 两端对齐行的方式与 distribute 相同,也同样不包含两段对齐段落的最后一行。适用于表意字文档
distribute-center-last : 未实现
inter-cluster : 调整文本无词间空格的行。这种模式的调整是用于优化亚洲语言文档的
inter-ideograph : 为表意字文本提供完全两端对齐。他增加或减少表意字和词间的空格
inter-word : 通过增加字之间的空格对齐文本。该行为是对齐所有文本行最快的方法。它的两端对齐行为对段落的最后一行无效
kashida : 通过拉长选定点的字符调整文本。这种调整模式是特别为阿拉伯脚本语言提供的。需要ie5.5+支持
newspaper : 通过增加或减少字或字母之间的空格对齐文本。是用于拉丁文字母表两端对齐的最精确格式
说明:
设置或检索对象内调整文本使用的对齐方式。
因为这个属性影响文本布局,所以 text-align 属性必须被设置为 justify 。
此属性只作用于块对象。
此属性对于 currentstyle 对象而言是只读的。对于其他对象而言是可读写的。
对应的脚本特性为 textjustify 。

例子:
 

复制代码 代码示例:
div {text-justify : auto; text-align:justify; }