<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            網頁設計常用HTML代碼

            時間:2024-10-25 11:50:17 HTML 我要投稿
            • 相關推薦

            網頁設計常用HTML代碼大全

              HTML是用來描述網頁的一種語言。下面yjbys小編為大家分享HTML代碼,希望對大家學習html代碼有幫助!

              忽視右鍵

              <body oncontextmenu="return false">

              或

              <body style="overflow-y:hidden">

              1.如何幾秒后轉到別的頁面?

              <META HTTP-EQUIV="Refresh" CONTENT="時間;URL=地址">

              2.點擊關閉窗口

              <a href="javascript:top.window.close();">點擊關閉窗口</a>!

              3.請問如何去掉主頁右面的滾動條?

              <body scroll="no">

              <body style="overflow-y:hidden">

              4.請問如何做到讓一個網頁自動關閉.

              <html>

              <head>

              <OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">

              <param name="Command" value="Close">

              </object>

              </head>

              <body onload="window.setTimeout(‘‘‘‘closes.Click()‘‘‘‘,10000)">

              這個窗口會在10秒過后自動關閉,而且不會出現提示. </body>

              如何在不刷新頁面的情況下刷新css?

              <style>

              button{ color:#000000;}

              </style>

              <button onclick=document.styleSheets[0].rules[0].style.color=‘‘‘‘red‘‘‘‘>點擊按鈕直接修改style標簽里button選擇符使按鈕改為紅色</button>

              請問如何讓網頁自動刷新?

              在head部記入<META HTTP-EQUIV="Refresh" content="20">其中20為20秒后自動刷新,你可以更改為任意值。

              5.如何讓頁面自動刷新?

              方法一,用refresh

              HTML 代碼片段如下:

              <head>

              <meta http-equiv="refresh" content="5">

              </head>

              5表示刷新時間

              [Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行]

              方法二,使用setTimeout控制

              <img src=/logo.gif>

              <script>

              function rl(){

              document.location.reload()

              }

              setTimeout(rl,2000)

              </script>

              6.如何讓超鏈接沒有下劃線

              在源代碼中的<HEAD>…</HEAD>之間輸入如下代碼:

              <style type="text/css"> <!--

              a { text-decoration: none}

              --> </style>

              7.請問如何去掉IE的上下滾動條?

              <body style=‘‘‘‘overflow:scroll;overflow-y:hidden‘‘‘‘>

              </body>

              8.怎樣才能把RealPlayer文件在網頁做一個試聽連接?

              <embed height=25 src=51js.rm type=audio/x-pn-realaudio-plugin width=50 autostart="false" controls="PlayButton">

              9.如何用html實現瀏覽器上后退按鈕的功能?

              <a href="java script:history.go(-1)">點擊后退</a>

              或者

              <script> history.back() </script>

              10.請問怎么在網頁中改變鼠標的箭頭形狀?

              HTML 代碼片段如下:

              <body>

              <a href="#" style="cursor: auto;">auto</a><br>

              <a href="#" style="cursor: crosshair ">crosshair </a><br>

              <a href="#" style="cursor: default ">default </a><br>

              <a href="#" style="cursor: hand ">hand </a><br>

              <a href="#" style="cursor: move ">move </a><br>

              <a href="#" style="cursor: e-resize ">e-resize </a><br>

              <a href="#" style="cursor: ne-resize ">ne-resize </a><br>

              <a href="#" style="cursor: nw-resize">nw-resize</a><br>

              <a href="#" style="cursor: n-resize">n-resize</a><br>

              <a href="#" style="cursor: se-resize">se-resize</a><br>

              <a href="#" style="cursor: sw-resize">sw-resize</a><br>

              <a href="#" style="cursor: s-resize">s-resize</a><br>

              <a href="#" style="cursor: w-resize">w-resize</a><br>

              <a href="#" style="cursor: text">text</a><br>

              <a href="#" style="cursor: wait">wait</a><br>

              <a href="#" style="cursor: help">help</a><br>

              </body>

              11.怎樣不使用頁面的緩存?即每一次打開頁面時不是調用緩存中的東西

              <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

              12.頁面打開時自動彈出一個窗口的代碼怎么寫?

              HTML 代碼片段如下:

              <html>

              <head>

              <title>Untitled Document</title>

              <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

              <script language="<B style="color:black;background-color:#A0FFFF">javascript</B>">

              <!--

              function MM_openBrWindow(theURL,winName,features) { //v2.0

              window.open(theURL,winName,features);

              }

              //-->

              </script>

              </head>

              <body bgcolor="#FFFFFF" text="#000000" onLoad="MM_openBrWindow(‘‘‘‘http://www.35ui.cn/‘‘‘‘,‘‘‘‘,‘‘‘‘width=400,height=400‘‘‘‘)">

              </body>

              </html>

              13.如何讓我的頁面出現一個會講話的小人?Merlin

              HTML 代碼片段如下:

              <HTML>

              <HEAD>

              <TITLE>默林</TITLE>

              <META http-equiv=Content-Type content="text/html; charset=gb2312">

              </HEAD>

              <BODY>

              <p><OBJECT id=sims classid=CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F>

              </OBJECT>

              <SCRIPT>

              var MerlinID;

              var MerlinACS;

              sims.Connected = true;

              MerlinLoaded = LoadLocalAgent(MerlinID, MerlinACS);

              Merlin = sims.Characters.Character(MerlinID);

              Merlin.Show();

              Merlin.Play("Surprised");

              Merlin.Speak("大家好");

              Merlin.Play("GestureLeft");

              Merlin.Think("我是默林!");

              Merlin.Play("Pleased");

              Merlin.Think("可愛嗎?");

              Merlin.Play("GestureDown");

              Merlin.Speak("哈哈!");

              Merlin.Hide();

              function LoadLocalAgent(CharID, CharACS){

              LoadReq = sims.Characters.Load(CharID, CharACS);

              return(true);

              }

              </SCRIPT>

              </p>

              <p> </p>

              <p>看此效果必須裝有office2000!!!</p>

              </BODY>

              </HTML>

              14.在頁面中如何加入不是滿鋪的背景圖片,拉動頁面時背景圖不動

              HTML 代碼片段如下:

              <html><head>

              <STYLE>

              body  {background-image:url(logo.gif);

              background-repeat:no-repeat; background-position:center }

              </STYLE>

              </head>

              <body bgproperties="fixed" >

              </body>

              </html>

              [Ctrl+A 全部選擇 提示:你可先修改部分代碼,再按運行]

              background-repeat:no-repeat; 是讓背景圖不占滿整個頁面

              body bgproperties="fixed" 是拉動scroll時背景圖不動

              15.文本輸入框什么屬性能實現不可輸入?

              HTML 代碼片段如下:

              <input type="text" name="textfield" disabled>

              或者

              <input type="text" name="textfield" readonly>

              16.如何禁止自己的頁面在別人的框架里打開?

              把以下代碼加至你的<head>區

              <script>

              if (window.top!=self){

              window.top.location=self.location

              }

              </script>

              17.如何實現首頁全屏幕顯示?

              HTML 代碼片段如下:

              <html>

              <body><script language="<B style="color:black;background-color:#A0FFFF">javascript</B>">

              var coolw=642

              var coolh=400

              var coolhuang=window.open("http://www.35ui.cn","coolhuang","width="+coolw+",height="+coolh+",

              fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0")

              window.close()

              </script></body></html>

              18.如何監聽一個窗口被關閉了?

              HTML 代碼片段如下:

              <body onunload="alert(‘‘‘‘你關閉了這個窗口‘‘‘‘)">

              19.如何禁止Ctrl+N?

              HTML 代碼片段如下:

              <body onkeydown=return(!(event.keyCode==78&&event.ctrlKey))>

              如何把頁面加入用戶的收藏夾?

              HTML 代碼片段如下:

              <a href="<B style="color:black;background-color:#A0FFFF">javascript</B>:window.external.AddFavorite(‘‘‘‘http://www.35ui.cn‘‘‘‘,‘‘‘‘無憂腳本‘‘‘‘)">收藏無憂腳本</a>

              如何在我的頁面中加入背景音樂?

              IE: <bgsound src="*.mid" loop=infinite>

              NS:<embed src="*.mid" autostart=true hidden=true loop=true>

              *.mid你的背景音樂的midi格式文件

              關于頁面轉換效果

              <meta http-equiv="page-enter" content="revealTrans(Duration=4,Transition=23)">

              或

              <meta http-equiv="page-exit" content="revealTrans(Duration=4,Transition=23)">

              說明:Transition=23是隨機效果,另可以選0-22任一數字固定某個效果

              如何設定打開頁面的大小

              HTML 代碼片段如下:

              <body onload="top.resizeTo(300,200);"><!--(width,height)-->

              怎樣雙擊滾屏,單擊停止?

              HTML 代碼片段如下:

              <html>

              <head>

              <title>新網頁1</title>

              </head>

              <body>

              <script language"<B style="color:black;background-color:#A0FFFF">javascript</B>">

              var currentpos,timer;

              function initialize()

              {

              timer=setInterval("scrollwindow()",10);

              }

              function sc(){

              clearInterval(timer);

              }

              function scrollwindow()

              {

              currentpos=document.body.scrollTop;

              window.scroll(0,++currentpos);

              if (currentpos != document.body.scrollTop)

              sc();

              }

              document.onmousedown=sc

              document.ondblclick=initialize

              </script>

              <p>a</p><p>a</p><p>a</p><p>aa</p><p>aa</p><p>aa</p>

              <p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p>

              <p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>aa</p>

              <p>aa</p><p>aa</p><p>aa</p><p>aa</p><p>a</p>

              </body>

              </html>

              如何讓body中的文字不被選中?

              HTML 代碼片段如下:

              <body onselectstart="return false" >aaa</body>

              如何讓彈出的窗口不能關閉?

              在新開的窗口中加入如下代碼

              <body onunload=open(location.href)>

              </body>

              如何讓瀏覽器在保存頁面時保存失敗?

              HTML 代碼片段如下:

              <NOSCRIPT>

              <<B style="color:black;background-color:#ffff66">IFRAME</B> SRC="*.html">

              </<B style="color:black;background-color:#ffff66">IFRAME</B>>

              </NOSCRIPT>

              表單中如何用圖片按鈕實現 reset?

              <html>

              <head>

              <script>

              function aaa(){

              document.forms[0].reset()

              }

              </script>

              </head>

              <body>

              <form>

              <textarea rows="2" name="S1" cols="20"></textarea>

              <input type="submit" values="提交" name="B1">

              <image src="logo.gif" onclick=aaa()>

              </form>

              </body></html>

              進入網頁時彈出的信息對話框

              <body onLoad="window.alert(‘‘‘‘歡迎光臨本站‘‘‘‘)">

              關閉窗口后彈出對話框

              <body onUnload="window.alert(‘‘‘‘謝謝你的光臨!歡迎下次再來!‘‘‘‘)">

              告別提示

              <body onUnload= alert("再見,感謝你的訪問!")>

              右鍵菜單的制作

              <OBJECT id=menu type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">

              <PARAM name="Command" value="Related Topics,menu">

              <PARAM name="Item1" value="動易;http://www.35ui.cn">

              <PARAM name="Item2" value="搜狐;http://www.35hu.cn">

              <PARAM name="Item3" value="新浪;http://www.35no.cn">

              <PARAM name="Item4" value="網易;http://www.chinsgp.cn">

              <PARAM name="Item5" value="互動學院;http://www.35ui.cn">

              </OBJECT> <script> if (document.all) document.body.onmousedown=new Function("if (event.button==2) menu.Click();") </script>

              下拉菜單

              <object id=HHCtrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"> <PARAM name="Command" value="Related Topics,Menu"> <PARAM name="Item1" value="aspease;http://www.35ui.cn"> <PARAM name="Item2" value="byhu;http://www.35ui.cn"> <PARAM name="Item3" value="lzz;http://www.35ui.cn"> </object> <a href=javascript:HHCtrl.Click() title="下拉菜單">下拉菜單</a>

            【網頁設計常用HTML代碼】相關文章:

            過濾HTML代碼08-29

            php如何過濾危險html代碼09-21

            HTML語言的網頁教程06-14

            2017年html的超簡代碼模版10-22

            如何在HTML頁面插入flash代碼01-21

            網頁程序設計之實用JavaScript代碼段09-23

            網頁程序設計之分享幾個css小眾代碼08-09

            JavaScript實現網頁刷新代碼段08-07

            網頁設計常用尺寸大小02-16

            收集的常用的HTML標簽01-22

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看