做网页设计的朋友,会遇到想控制文字左右对齐的困扰吗?如果您遇到了,请看下面的方法,注意CSS一定要写在里面,不要用外链式,否则效果会没有:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<p>两端对齐</p>
英文对齐:<br>
<div style="font-size:12px;width:300px;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:300px;text-align:justify; text-justify:inter-ideograph">
上周五突然决定去鄱阳湖看鸟了,晚上没票,只好买了周六晚上的,没有拍鸟必用的专业相机与超长焦的镜头,甚至也没有一个望远镜,就匆匆出发了。今天上午九点走出南昌火车站,坐上一辆上中巴到永修县城,再挤进一个小面包,终于在中午到达了这个鄱阳湖畔的小镇??吴城。除了从附近两个城市南昌和九江来的游客,恐怕再没有远地方来的游人了,更别说背包客,到了晚上,竟只剩我一个外地人。在小面包上碰到的三个九江外国语学校的老师,一路同行也仅止于在镇子里匆忙逛一下就回去了。</div>
</body>
</html>
评论