请使用css中的
text-align: justify;
HTML 代码片段如下:
<table style="TABLE-LAYOUT: fixed" width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#f7f7f7">
<tr>
<td style="LEFT: 0px; WIDTH: 100%; text-align: justify"><font color="#990000">[效果]</font><br>
who are you you are a aaa is it comprehention who are you you are a pig is it comprehention
who are you you are a aaa is it comprehention
who are you you are a aaa is it comprehention
</font></td>
</tr>
</table>
作者:堕落天使
Tags: html, javascript
mark
<script>
alert(screen.width+"*"+screen.height)
</script>
—————————————————————
screen.width
—————————————————————
<script>
function centerWindow(url,w,h){
l=(screen.width-w)/2
t=(screen.height-h)/2
window.open(url,'','left='+l+',top='+t+',width='+w+',height='+h)
}
</script>
<input type=button onclick="centerWindow('about:blank',200,200)">
—————————————————————
<body>
<SCRIPT LANGUAGE="JavaScript">
var s ="网页可见区域宽:"+ document.body.clientWidth;
s+="\r\n网页可见区域高:"+ document.body.clientHeight;
s += "\r\n网页正文全文宽:"+ document.body.scrollWidth;
s += "\r\n网页正文全文高:"+ document.body.scrollHeight;
s += "\r\n网页正文部分上:"+ window.screenTop;
s += "\r\n网页正文部分左:"+ window.screenLeft;
s += "\r\n屏幕分辨率的高:"+ window.screen.height;
s += "\r\n屏幕分辨率的宽:"+ window.screen.width;
s +="\r\n屏幕可用工作区高度:"+ window.screen.availHeight;
s +="\r\n屏幕可用工作区宽度:"+ window.screen.availWidth;
alert(s);
</SCRIPT>
—————————————————————
<SCRIPT LANGUAGE="JavaScript">
<!– Begin
function redirectPage() {
/*var url640x480 = "http://www.yoursite.com/640×480.html";**记得改相应的页面*/
var url800x600 = "index1.asp";
var url1024x768 = "index2.asp";
/*if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;*/
if (screen.width <= 800 )
window.location.href= url800x600;
else if ((screen.width >= 1024) )
window.location.href= url1024x768;
}
// End –>
</script>
======================================
<SCRIPT FOR=window EVENT=onload LANGUAGE="JavaScript">
initAd();//载入页面后,调用函数initAd()
</SCRIPT>
<script language="JavaScript">
<!–
function initAd() {
document.all.AdLayer.style.posTop = -200;
//设置onLoad事件激发以后,广告层相对于固定后的y方向位置
document.all.AdLayer.style.visibility = 'visible'//设置层为可见
MoveLayer('AdLayer');//调用函数MoveLayer()
}
function MoveLayer(layerName) {
var x = 600;//浮动广告层固定于浏览器的x方向位置
var y = 300;//浮动广告层固定于浏览器的y方向位置
var diff = (document.body.scrollTop + y – document.all.AdLayer.style.posTop)*.40;
var y = document.body.scrollTop + y – diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posLeft = x");//移动广告层
setTimeout("MoveLayer('AdLayer');", 20);//设置20毫秒后再调用函数MoveLayer()
}
//–>
</script>
<!–下面为一个ID为AdLayer的层(如ID名不为AdLayer,
上面MoveLayer()内的AdLayer也要作相应修改),包括一张带链接的图片–>
<div id=AdLayer style='position:absolute; width:61px; height:59px; z-index:20; visibility:hidden;; left: 600px; top: 300px'>
<script>
var YahooCNADConfig=new Array();
YahooCNADConfig['adid']=909
YahooCNADConfig['wid']=28709
YahooCNADConfig['w']=110
YahooCNADConfig['h']=300
</script>
<script type='text/javascript' src='http://view.aliunion.cn.yahoo.com/showad.php'></script>
</div>
作者:jock
Tags: html, javascript
总类(所有HTML文件都有的)
文件类型 <HTML></HTML> (放在档案的开头与结尾)
文件主题 <TITLE></TITLE> (必须放在「文头」区块内)
文头 <HEAD></HEAD> (描述性资料,像是「主题」)
文体 <BODY></BODY> (文件本体)
结构性定义(由浏览器控制的显示风格)
标题 <H?></H?> (从1到6,有六层选择)
3.0 标题的对齐 <H? ALIGN=LEFT|CENTER|RIGHT></H?>
3.0 区分 <DIV></DIV>
3.0 区分的对齐 <DIV ALIGN=LEFT|RIGHT|CENTER|JUSTIFY></DIV>
引文区块 <BLOCKQUOTE></BLOCKQUOTE> (通常会内缩)
强调 <EM></EM> (通常会以斜体显示)
特别强调 <STRONG></STRONG> (通常会以加粗显示)
引文 <CITE></CITE> (通常会以斜体显示)
码 <CODE></CODE> (显示原始码之用)
样本 <SAMP></SAMP>
键盘输入 <KBD></KBD>
变数 <VAR></VAR>
定义 <DFN></DFN> (有些浏览器不提供)
地址 <ADDRESS></ADDRESS>
3.0 大字 <BIG></BIG>
3.0 小字 <SMALL></SMALL>
与外观相关的标签(作者自订的表现方式)
加粗 <B></B>
斜体 <I></I>
3.0 底线 <U></U> (尚有些浏览器 阅读全文 »
作者:jock
Tags: html, 参考手册
近期评论