东莞市汽车网

标题: 网页编程的九个常用技巧 [打印本页]

作者: 我不知道阿哈    时间: 2012-5-14 11:19
标题: 网页编程的九个常用技巧
一、请问如何让一康熙来了个打开的窗口在限定时[url=http://zone.auto.msn.com.cn/bbs/thread-1639334-1-1.html]80后夫妻[/url<body onload="setTimeout(window.close(),2000)">
两秒钟关闭(1s=1000微秒)
</body>

二、滚动条不显示就在<body>里加style="overflow:hidden"
去掉框架线在<frame>中加frameborder=0
<frameset cols="*,150" framespacing=10>
<frame noResize frameborder=1 src="about:blank">
<frame noResize frameborder=1 src="about:blank">
</frameset>

三、请问怎么把它搞成只有外面的线,表里面所有线都不要
<table width="75%" border="1" cellspacing="0" bordercolor="#FF0000" rules=none>
<tr> <td> </td><td> </td></tr><tr> <td> </td><td> </td></tr><tr> <td> </td><td> </td></tr><tr> <td> </td><td> </td></tr><tr> <td> </td><td> </td></tr>
</table>
<center>
<table border="0" cellpadding="0" cellspacing="0" width="80%" style="border: 1 solid #FF0000">
<tr><td width="50%" height="10"></td><td width="50%" height="10"></td></tr>
<tr><td width="50%" height="10"></td><td width="50%" height="10"></td></tr>
<tr><td width="50%" height="10"></td><td width="50%" height="10"></td></tr>
<tr><td width="50%" height="10"></td><td width="50%" height="10"></td></tr>
<tr><td width="50%" height="10"></td><td width="50%" height="10"></td></tr>
</table>
</center>

四、网页上的联接鼠标指针变化,图片指针~~~
<style>
*{font-size:12px}
:visited,:active,:link{ text-decoration:none;color:navy}
:hover{ cursor:url)}
</style>
<a href=#>Link</a>

五、一张图片,看起来很模糊,可是把鼠标移在那张图片的上面,就变得清晰
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="JavaScript">
// Flash Image Extension for Dreamwever ,by Yichun Yuan(dezone@sina.com)
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ //do this so I can take a string too
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects

["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}

</script>
</head>
<body>
src="/uploadfile/UploadFile/200919162231365.gif" onMouseOut=nereidFade(this,50,10,5) onMouseOver=nereidFade(this,100,10,5) style="FILTER: alpha(opacity=50)"></a>

</body>
</html>

六、用javscript打开图片新窗口用什么代码?
<img src="images/postnew.gif" onclick="window.open(,,width=200,height=200)"><a href="javascript:void(window.open(,,width=200,height=200))"><img src="images/postnew.gif"></a>

七、在一个表格框中如何控制段落行距?
CSS中LINE-HEIGHT的就定义行距的。
style="line-height:4"

八、在同一页面怎么采用不同的hover和link、visited?
a:active {font-size: 12px;color: #0066cc;text-decoration: none; }
a:visited {font-size: 12px;color: #0D0D15;text-decoration: none;}
a:hover {font-size: 12px;color: #0066cc;text-decoration: underline;}
a:link {font-size: 12px;color: #0D0D15;text-decoration: none;}
a.b:active { font-size: 12px; color: #ff0000; text-decoration: underline;}
a.b:visited { font-size: 12px; color: #ff0000;}
a.b:hover { font-size: 12px; color: #ff6600OSITION: relative; LEFT: 1px; TOP: 1px;}
a.b:link { font-size: 12px; color: #ff0000; text-decoration: underline;}</style>
<body>
<p align="center"><a href="#">默认的链接样式 </a></p>
<p align="center"><a href="#" class="b">链接样式表b</a> </p>
</body>
注:如果是自定义类 .111 a:hover{*****},则只能在非<a>标记里引用,比如<td class="111">。如果定义类为 a.111:hover{*****},则只能在<a>标记里引用,如<a class="111">

九、针对图片限制:table-layout:fixed;
针对汉字限制,但对英文不能自动换行:word-break:break-all;
<table width="250" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td height="200" style="word-break:break-all">这里使用的是word-break:break-all,单元格高度自定义为 200px。510sj.com、510sj.com、510sj.com、510sj.com、510sj.com、510sj.com、 510sj.com、510sj.com、</td>
</tr>
</table>




欢迎光临 东莞市汽车网 (http://bbs.qc0769.com/) Powered by Discuz! X3.2