HTML小技巧

来源:互联网 发布:淘宝dsr在哪里看 编辑:程序博客网 时间:2024/05/21 19:50
  1. 01.让背景图不滚动   
  2.   
  3. IE浏览器支持一个 Body 属性 bgproperties,它可以让背景不滚动:    
  4.   
  5. 〈Body Background="图片文件" bgproperties="fixed"〉    
  6.   
  7.   
  8.   
  9. 02.让你的网页无法另存为   
  10.   
  11. <noscript><iframe src=*></iframe></noscript>    
  12.   
  13.   
  14.   
  15. 03.让IFRAME框架内的文档的背景透明   
  16.   
  17. <iframe src="about:<body style=&apos;background:transparent&apos;>" allowtransparency></iframe>  
  18.   
  19.   
  20.   
  21. 04.禁止右键:   
  22.   
  23. <body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()">    
  24.   
  25.   
  26.   
  27. 05.进入页面后立即自动刷新?   
  28.   
  29. <meta http-equiv="refresh" content="120;url=http://www.XYZ.com/XYZ">  
  30.   
  31. http://www.XYZ.com/XYZ,这是你自己的网址。   
  32.   
  33.   
  34.   
  35. 06.打开窗口即最大化   
  36.   
  37. <script language="JavaScript">    
  38.   
  39. <!-- Begin    
  40.   
  41. self.moveTo(0,0)   
  42.   
  43. self.resizeTo(screen.availWidth,screen.availHeight)   
  44.   
  45. // End -->    
  46.   
  47. </script>  
  48.   
  49.   
  50.   
  51. 07.能隐藏IFRAME的滚动条吗?我知道的三种方法:   
  52.   
  53. 1. 设置iframe scrolling="no"  
  54.   
  55. 2. 被包含页body应用overflow:hidden 即在被包含页中应用15.如何控制横向和纵向滚动条的显隐?   
  56.   
  57. 3. 被包含页的body标签加scroll="no"  
  58.   
  59.   
  60.   
  61. 08.加入背景音乐   
  62.   
  63. <bgsound src="mid/windblue[1].mid" loop="-1"> 只适用于IE   
  64.   
  65.   
  66.   
  67. <embed src="music.mid" autostart="true" loop="true" hidden="true"> 对Netscape ,IE 都适用   
  68.   
  69.   
  70.   
  71. 09.嵌入网页   
  72.   
  73. <iframe name="tt" src="01a.html" width="450" height="287" scrolling="Auto" frameborder="0"></iframe>  
  74.   
  75.   
  76.   
  77. 10.跳转   
  78.   
  79. <meta http-equiv="refresh" content="3;URL=list.htm">  
  80.   
  81.   
  82.   
  83. 11.滚动   
  84.   
  85. <MARQUEE direction=up height=146 onmouseout=start() onmouseover=stop() scrollAmount=4></marquee>  
  86.   
  87.   
  88.   
  89. 12.细线分隔线   
  90.   
  91. <hr noshade size=0 color=#C0C0C0>  
  92.   
  93.   
  94.   
  95. 13.过度方式   
  96.   
  97. <meta http-equiv="Page-Exit" content="revealTrans(Duration=3,Transition=5)">  
  98.   
  99. Duration的值为网页动态过渡的时间,单位为秒。   
  100.   
  101. Transition是过渡方式,它的值为0到23,分别对应24种过渡方式。如下表:   
  102.   
  103. 0 盒状收缩 1 盒状放射 2 圆形收缩 3 圆形放射 4 由下往上   
  104.   
  105. 5 由上往下 6 从左至右 7 从右至左 8 垂直百叶窗 9 水平百叶窗   
  106.   
  107. 10 水平格状百叶窗 11垂直格状百叶窗 12 随意溶解 13从左右两端向中间展开   
  108.   
  109. 14 从中间向左右两端展开 15 从上下两端向中间展开   
  110.   
  111. 16 从中间向上下两端展开 17 从右上角向左下角展开   
  112.   
  113. 18 从右下角向左上角展开 19 从左上角向右下角展开   
  114.   
  115. 20 从左下角向右上角展开 21 水平线状展开   
  116.   
  117. 22 垂直线状展开 23 随机产生一种过渡方式   
  118.   
  119.   
  120.   
  121.   
  122.   
  123. 14.加入注释的格式是:       
  124.   
  125. 〈!-[注释内容…]--〉   
  126.   
  127.   
  128.   
  129. 15.如何控制横向和纵向滚动条的显隐?   
  130.   
  131. <body style="overflow-y:hidden"> 去掉x轴   
  132.   
  133. <body style="overflow-x:hidden"> 去掉y轴   
  134.   
  135. <body scroll="no">不显。   
  136.   
  137.   
  138.   
  139. 16.定制浏览器地址栏前的小图标:   
  140.   
  141. A:在网页的〈head〉〈/head〉间加入以下语句:   
  142.   
  143. 〈link rel="shortcuticon" href="http://…/icon.ico"〉   
  144.   
  145. 即可。其中 icon.ico 为 16x16 的图标文件,颜色不要超过 16 色。   
  146.   
  147.   
  148.   
  149. 17.怎样在网页中加入 E-mail 链接并显示预定的主题?    
  150.   
  151. 〈A href="mailto:Name@Your.net?subject=主题"〉……〈/a〉    
  152.   
  153.   
  154.   
  155. 18.定义本网页关键字,可以在〈Head〉〈/Head〉中加入如下代码:      
  156.   
  157. 〈meta name="Keywords" content="china,enterprise,business,net"〉       
  158.   
  159. Content 中所包含的就是关键字,你可以自行设置。       
  160.   
  161. 这里有个技巧,你可以重复某一个单词,这样可以提高自己网站的排行位置,如:    
  162.   
  163. 〈meta name="Keywords" content="china,china,china,china"〉 这个关键字对于Google搜索无效。   
  164.   
  165.   
  166.   
  167. 19.添加到收藏夹:   
  168.   
  169. 〈a href="javascript :window.external.addFavorite(&apos;http://链接&apos;,&apos;说明&apos;);"〉添加到收藏夹〈/a〉   
  170.   
  171.   
  172.   
  173. 20.设为首页:   
  174.   
  175. 〈a href=# onclick=this.style.behavior=&apos;url(#default#homepage)&apos;;this.setHomePage(&apos;http://链接&apos;);〉设为首页〈/a〉   
  176.   
  177.   
  178.   
  179. 21.把滚动条放在浏览器窗口的左边   
  180.   
  181. A:在 <body> 中加 dir=RTL,即 <body dir=RTL>。   
  182.   
  183.   
  184.   
  185. 另附:IE5.0 的部分快捷键:    
  186.   
  187. A:打开查找功能:Ctrl+F    
  188.   
  189. 关闭浏览器窗口:Ctrl+W    
  190.   
  191. 打开地址栏下拉列表框:F4    
  192.   
  193. 刷 新:F5    
  194.   
  195. 将当前Web页保存到收藏夹列表:Ctrl+D    
  196.   
  197. 打开当前 IE 窗口的一个拷贝:Ctrl+N    
  198.   
  199. 停止下载当前网页:Esc    
  200.   
  201. 光标迅速移动到网页的开头:Home    
  202.   
  203. 光标迅速移动到网页的尾部:End    
  204.   
  205. 打开新的地址键入窗口:Ctrl+O    
  206.   
  207. 打开收藏夹:Ctrl+I    
  208.   
  209. 打开历史记录文件夹:Ctrl+H    
  210.   
  211. 打开浏览器设定的默认主页:Alt+HOME   
原创粉丝点击