DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> WEB網站前端 >> 關於網頁技巧
值得收藏:50 條網頁製作實用小技巧
編輯:關於網頁技巧     

以下整理一批常用的網頁製作技巧程式碼,方便隨查隨用。

控制橫向與縱向捲軸的顯隱
<body style="overflow-y:hidden"> 去掉 x 軸
<body style="overflow-x:hidden"> 去掉 y 軸
<body scroll="no"> 不顯示捲軸

表格滑鼠移入變色
<TD onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''" style="CURSOR: hand">

禁止複製、滑鼠拖曳選取
<body ondragstart=window.event.returnValue=false oncontextmenu=window.event.returnValue=false onselectstart=event.returnValue=false>

普通 iframe 頁面
<iframe name="name" src="main.htm" width="450" height="287" scrolling="Auto" frameborder="0"></iframe>

iframe 自適應高度
<iframe name="pindex" src="index.asp" frameborder=false scrolling="auto" width="100%" height="100%" onload="document.all['pindex'].style.height=pindex.document.body.scrollHeight"></iframe>

在 IE 位址欄顯示自訂圖示並加入我的最愛
<link rel="Shortcut Icon" href="favicon.ico">
<link rel="Bookmark" href="favicon.ico">

字級縮放
長時間泡網的人越來越多,讓文字大一點、讓使用者看得更清楚。
<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>

解決 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>

以上僅為部分技巧,更多實用小語法可延伸應用於日常網頁製作中。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved