Net2u 网页设计小技巧

2008-03-25 20:21:18 by 【6yang】, 25 visits, 收藏 | 返回
.如何控制横向和纵向滚动条的显隐?
<body style="overflow-y:hidden"> 去掉x轴滚动条
<body style="overflow-x:hidden"> 去掉y轴滚动条
<body scroll="no">不显

2.表格变色
<TD onmouseover="this.style.backgroundColor='#FFFFFF'"
onmouseout="this.style.backgroundColor=''" style="CURSOR: hand"> 

3.禁止复制,鼠标拖动选取
<body ondragstart=window.event.returnValue=false oncontextmenu=window.event.returnValue=false 
onselectstart=event.returnValue=false> 

4.iframe的使用
<iframe  src="a.htm" width="50" height="50"  frameborder="0"></iframe>

5.在收藏夹及IE地址栏中显示出你的图标
<link rel="Shortcut Icon" href="favicon.ico">
<link rel="Bookmark" href="favicon.ico">

6.字号缩放
越来越多的人长时间的泡网,眼镜的普及率也越来越高,让文字大点,让更多的用户看的更清楚。
<script type="text/javascript">
function doZoom(size)
{document.getElementById('zoom').style.fontSize=size+'px';}
</script>
<span id="zoom">需要指定大小的文字</span>
<a href="Javascript:doZoom(16)">大</a> <a href="javascript:doZoom(14)">中</a> <a href="javascript:doZoom(12)">小</a>

7.select挡住div的解决方法 
在div里加入下面的代码,根据需要调整就可以了。
<iframe src="javascript:false" scrolling="no" frameborder="0" style="z-index:-1;position:absolute; top:5px; left:2px;width:168;height:100px;">
</iframe>

8.跳转菜单新窗口
<select name="select" onchange="window.open(this.options[this.selectedIndex].value)">
<option value="http://www.lihao.name"> lihao</option>
<option value="http://www.nai8.com"> nai8</option>
<option value="http://www.akbk.net"> akbk</option>
</select> 

9.flash透明选项
<param name="wmode" value="transparent"> 

10.显示网页的最后更新时间 
<script language=JavaScript> 
document.write("最后更新时间: " + document.lastModified + "") 
</script> 

11.添加到收藏夹和设为首页
<a href=# onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.lihao.name/');">设为首页</a>

[1] [2] [3] [4] 下一页 
分享到:
share

    图片原图

    loading

    loading