网页移动代码大全
- 格式:doc
- 大小:40.50 KB
- 文档页数:9
织网建站:很全哦Html网页的代码Html网页的代码很全哦1)贴图:<img src="图片地址">2)加入连接:<a href="所要连接的相关地址">写上你想写的字</a>1)贴图:<img src="图片地址">2)加入连接:<a href="所要连接的相关地址">写上你想写的字</a>3)在新窗口打开连接:<a href="相关地址" target="_blank">写上要写的字</a>消除连接的下划线在新窗口打开连接:<a href="相关地址" style="text-decoration:none" target="_blank">写上你想写的字</a>4)移动字体(走马灯):<marquee>写上你想写的字</marquee>5)字体加粗:<b>写上你想写的字</b>6)字体斜体:<i>写上你想写的字</i>7)字体下划线: <u>写上你想写的字</u>8)字体删除线: <s>写上你想写的字</s>9)字体加大: <big>写上你想写的字</big>10)字体控制大小:<h1>写上你想写的字</h1> (其中字体大小可从h1-h5,h1最大,h5最小)11)更改字体颜色:<font color="#value">写上你想写的字</font>(其中value值在000000与ffffff(16位进制)之间12)消除连接的下划线:<a href="相关地址" style="text-decoration:none">写上你想写的字</a>13)贴音乐:<embed src=音乐地址width=300 height=45 type=audio/mpeg autostart="false">14)贴flash: <embed src="flash地址" width="宽度" height="高度">15)贴影视文件:<img dynsrc="文件地址" width="宽度" height="高度" start=mouseover>16)换行:<br>17)段落:<p>段落</p>18)原始文字样式:<pre>正文</pre>19)换帖子背景:<body background="背景图片地址">20)固定帖子背景不随滚动条滚动:<body background="背景图片地址" bodybgproperties=fixed>21)定制帖子背景颜色:<body bgcolor="#value">(value值见10)22)帖子背景音乐:<bgsound="背景音乐地址" loop=infinite>23)贴网页:<iframe src="相关地址" width="宽度" height="高度"></iframe>/----------------------------------------HTML特效代码--------------------------------/1。
40个经典网页代码1231. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标4右键5<table border oncontextmenu=return(false)><td>no</table> 可用于6Table782. <body onselectstart="return false"> 取消选取、防止复制9103. onpaste="return false" 不准粘贴11124. oncopy="return false;" oncut="return false;" 防止复制13145. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自15己的图标16176. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出18你的图标19207. <input style="ime-mode:disabled"> 关闭输入法21228. 永远都会带着框架23<s cript language="Javas cript"><!--24if (window == top)top.location.href =25"frames.htm"; //frames.htm为框架网页26// --></s cript>27289. 防止被人frame29<s cript LANGUAGE=JAVAs cript><!--30if (top.location != self.location)top.location=self.location;31// --></s cript>323310. 网页将不能被另存为34<nos cript><iframe src=*.html></iframe></nos cript>353611. <input type=button value=查看网页源代码37onclick="window.location = "view-source:"+38"";">394012.删除时确认41<a href="javas cript:if(confirm("确实要删除吗?"))42location="boos.asp?&areyou=删除&page=1"">删除</a>434413. 取得控件的绝对位置45//Javas cript46<s cript language="Javas cript">47function getIE(e){48var t=e.offsetTop;49var l=e.offsetLeft;50while(e=e.offsetParent){51t+=e.offsetTop;52l+=e.offsetLeft;53}54alert("top="+t+"/nleft="+l);55}56</s cript>57//VBs cript58<s cript language="VBs cript"><!--59function getIE()60dim t,l,a,b61set a=document.all.img162t=document.all.img1.offsetTop63l=document.all.img1.offsetLeft64while a.tagName<>"BODY"65set a = a.offsetParent66t=t+a.offsetTop67l=l+a.offsetLeft68wend69msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"70end function71--></s cript>727314. 光标是停在文本框文字的最后74<s cript language="javas cript">75function cc()76{77var e = event.srcElement;78var r =e.createTextRange();79r.moveStart("character",e.value.length);80r.collapse(true);81r.select();82}83</s cript>84<input type=text name=text1 value="123" onfocus="cc()">858615. 判断上一页的来源87javas cript:88document.referrer899016. 最小化、最大化、关闭窗口91<object id=hh192classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">93<param name="Command" value="Minimize"></object>94<object id=hh2 95classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">96<param name="Command" value="Maximize"></object>97<OBJECT id=hh3 98classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">99<PARAM NAME="Command" VALUE="Close"></OBJECT>100<input type=button value=最小化 onclick=hh1.Click()>101<input type=button value=最大化 onclick=hh2.Click()>102<input type=button value=关闭 onclick=hh3.Click()>103本例适用于IE10410517.屏蔽功能键Shift,Alt,Ctrl106<s cript>107function look(){108if(event.shiftKey)109alert("禁止按Shift键!"); //可以换成ALT CTRL110}111document.onkeydown=look;112</s cript>11311418. 网页不会被缓存115<META HTTP-EQUIV="pragma" CONTENT="no-cache">116<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, 117must-revalidate">118<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> 119或者<META HTTP-EQUIV="expires" CONTENT="0">12012119.怎样让表单没有凹凸感?122<input type=text style="border:1 solid #000000">123或124<input type=text style="border-left:none;125border-right:none; border-top:none; border-bottom:1261 solid #000000"></textarea>12712820.<div><span>&<layer>的区别?129<div>(division)用来定义大段的页面元素,会产生转行130<span>用来定义同一行内的元素,跟<div>的唯一区别是不产生转行131<layer>是ns的标记,ie不支持,相当于<div>13213321.让弹出窗口总是在最上面:134<body onblur="this.focus();">13513622.不要滚动条?137让竖条没有:138<body style="overflow:scroll;overflow-y:hidden">139</body>140让横条没有:141<body style="overflow:scroll;overflow-x:hidden">142</body>143两个都去掉?更简单了144<body scroll="no">145</body>14614723.怎样去掉图片链接点击后,图片周围的虚线?148<a href="#" onFocus="this.blur()">149<img src="logo.jpg" border=0></a>15015124.电子邮件处理提交表单152<form name="form1" method="post"153action="mailt****@***.com" enctype="text/plain">154<input type=submit>155</form>15615725.在打开的子窗口刷新父窗口的代码里如何写?158window.opener.location.reload()15916026.如何设定打开页面的大小161<body onload="top.resizeTo(300,200);">162打开页面的位置<body onload="top.moveBy(300,200);">16316427.在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动165<STYLE>166body167{background-image:url(logo.gif); background-repeat:no-repeat; 168background-position:center;background-attachment: fixed}169</STYLE>17017128. 检查一段字符串是否全由数字组成172<s cript language="Javas cript"><!--173function checkNum(str){return str.match(//D/)==null}174alert(checkNum("1232142141"))175alert(checkNum("123214214a1"))176// --></s cript>17717829. 获得一个窗口的大小179document.body.clientWidth; document.body.clientHeight18018130. 怎么判断是否是字符182if (/[^/x00-/xff]/g.test(s)) alert("含有汉字");183else alert("全是字符");18418531.TEXTAREA自适应文字行数的多少186<textarea rows=1 name=s1 cols=27187onpropertychange="this.style.posHeight=this.scrollHeight"> 188</textarea>18919019132. 日期减去天数等于第二个日期192<s cript language=Javas cript>193function cc(dd,dadd)194{195//可以加上错误处理196var a = new Date(dd)197a = a.valueOf()198a = a - dadd * 24 * 60 * 60 * 1000199a = new Date(a)200alert(a.getFullYear() + "年" + (a.getMonth() + 1)201+ "月" + a.getDate() + "日")202}203cc("12/23/2002",2)204</s cript>20520633. 选择了哪一个Radio207<HTML><s cript language="vbs cript">208function checkme()209for each ob in radio1210if ob.checked then window.alert ob.value211next212end function213</s cript><BODY>214<INPUT name="radio1" type="radio" value="style" checked>Style 215<INPUT name="radio1" type="radio" value="barcode">Barcode 216<INPUT type="button" value="check" onclick="checkme()">217</BODY></HTML>21821934.脚本永不出错220<s cript LANGUAGE="Javas cript">221<!-- Hide222function killErrors() {223return true;224}225window.onerror = killErrors;226// -->227</s cript>22822935.ENTER键可以让光标移到下一个输入框230<input onkeydown="if(event.keyCode==13)event.keyCode=9"> 23123236. 检测某个网站的链接速度:233把如下代码加入<body>区域中:234<s cript language=Javas cript>235tim=1236setInterval("tim++",100)237b=1238var autourl=new Array()239autourl[1]=""240autourl[2]=""241autourl[3]=""242autourl[4]=""243autourl[5]=""244function butt(){245document.write("<form name=autof>")246for(var i=1;i<autourl.length;i++)247document.write("<input type=text name=txt"+i+" size=10 248value=测试中……> =》<input type=text249name=url"+i+" size=40> =》<input type=button value=GO 250onclick=window.open(this.form.url"+i+".value)><br>") 251document.write("<input type=submit value=刷新></form>") 252}253butt()254function auto(url){255document.forms[0]["url"+b].value=url256if(tim>200)257{document.forms[0]["txt"+b].value="链接超时"}258else259{document.forms[0]["txt"+b].value="时间"+tim/10+"秒"}260b++261}262function run(){for(var i=1;i<autourl.length;i++)263document.write("<img src=http://"+autourl+"/"+Math.random()+" 264width=1 height=1265onerror=auto("http://";+autourl+"")>")}266run()</s cript>26726837. 各种样式的光标269auto :标准光标270default :标准箭头271hand :手形光标272wait :等待光标273text :I形光标274vertical-text :水平I形光标275no-drop :不可拖动光标276not-allowed :无效光标277help :?帮助光标278all-scroll :三角方向标279move :移动标280crosshair :十字标281e-resize282n-resize283nw-resize284w-resize285s-resize286se-resize287sw-resize28828938.页面进入和退出的特效290进入页面<meta http-equiv="Page-Enter"291content="revealTrans(duration=x, transition=y)">292推出页面<meta http-equiv="Page-Exit"293content="revealTrans(duration=x, transition=y)">294这个是页面被载入和调出时的一些特效。
网页跳转代码大全<一>三种网页跳转代码:如果你要在服务器端跳转,可以这样:Response.Redirect()Response.End(这个是的服务器代码“常用的”)如果你要在客户端跳转,可以这样(js跳转):<script language="javascript" type="text/javascript">window.location="http: //";;</script>如果你要让页面显示几秒钟之后跳转,可以在html代码的<head></head>部分加上这样的代码:<meta http-equiv="refresh" content="3; url=">(3秒钟后自动跳转到)以上三种是也比较常见的页面跳转<二>几段简单的网页跳转代码不隐藏转向之后的地址代码一:<html><body><form name=loading><SCRIDIVT>var bar=0var line="||"var amount="||"count()function count(){bar=bar+2amount =amount + linedocument.loading.chart.value=amountdocument.loading.divercent.value=bar+"%"if (bar<99){setTimeout("count()",100);}else{window.location = "将这里改成要转入的网址";}}</SCRIDIVT></form></body></html>不隐藏转向之后的地址代码二:<html><body><scridivt language="javascridivt"><!--function goToURL() { //v2.0for (var i=0; i< (goToURL.arguments.length - 1); i+=2) //with arg divairs eval(goToURL.arguments+".location=''"+goToURL.arguments[i+1]+"''"); document.returnvalue = false;}//--></scridivt><body bgcolor="#FFFFFF"></body></html>不隐藏转向之后的地址代码三:<html><SCRIDIVT LANGUAGE="javascridivt"><!-- Start Codevar ver = navigator.adivdivVersion;if (ver.indexOf("MSIE") != -1){window.location.href="将这里改成要转入的网址如百度(httdiv:)" }elsewindow.location.href="将这里改成要转入的网址如百度(httdiv:)" // End Code --></SCRIDIVT></html>不隐藏转向之后的地址代码四:<html><body><meta httdiv-equiv="refresh" content="0.1;url=将这里改成要转入的网址"></body></html>可隐藏转向之后的地址:<html><frameset framesdivacing="0" border="0" rows="0" frameborder="0"><frame name="main" src="将这里改成要转入的网址" scrolling="auto" noresize></frameset></html><三>网页跳转<meta httdiv-equiv="refresh" content="3;rul=跳转的网页">此代码可以让网页在一定的时间内,跳转到另外一个网页上,其中content=" 为跳转前停暂的秒数,rul= 为跳转的网址<meta httdiv-equiv="refresh" content="3;rul=跳转的网页">此代码可以让网页在一定的时间内,跳转到另外一个网页上,其中content=" 为跳转前停暂的秒数,rul= 为跳转的网址===================================================================<html><head><title>网页跳转</title><meta httdiv-equiv="refresh" content="0;url=/"></head><body></body></html>===================================================================1,页面自动刷新:把如下代码加入<head>区域中<meta httdiv-equiv="refresh" content="20">,其中20指每隔20秒刷新一次页面.2,页面自动跳转:把如下代码加入<head>区域中<meta httdiv-equiv="refresh" content="10;url=h /">,其中10指隔10秒后跳转到/页面。
HTML代码教程教程一、基本标志1.<html></html>2.<head></head>3.<body></body>4.<title></title>Html是英文HyperText Markup Language 的缩写,中文意思是“超文本标志语言”,用它编写的文件(文档)的扩展名是.html或.htm,它们是可供浏览器解释浏览的文件格式。
您可以使用记事本、写字板或FrontPage Editor 等编辑工具来编写Html文件。
Html语言使用标志对的方法编写文件,既简单又方便,它通常使用<标志名></标志名>来表示标志的开始和结束(例如<html></html>标志对),因此在Html文档中这样的标志对都必须是成对使用的。
在此教程中,我先讲一下Html的基本标志:1.<html></html><html>标志用于Html文档的最前边,用来标识Html文档的开始。
而</html>标志恰恰相反,它放在Html文档的最后边,用来标识Html文档的结束,两个标志必须一块使用。
2.<head></head><head>和</head>构成Html文档的开头部分,在此标志对之间可以使用<title>< /title>、<script></script>等等标志对,这些标志对都是描述Html 文档相关信息的标志对,<head></head>标志对之间的内容是不会在浏览器的框内显示出来的。
两个标志必须一块使用。
3.<body></body><body></body>是Html文档的主体部分,在此标志对之间可包含<p>、< /p>、<h1>、</h1>、<br>、<hr>等等众多的标志,它们所定义的文本、图像等将会在浏览器的框内显示出来。
Html网页设计代码设计第一技术其次: )----------------------------------1)贴图:<img src="图片地址">2)加入连接:<a href="所要连接的相关地址">写上你想写的字</a>1)贴图:<img src="图片地址">2)加入连接:<a href="所要连接的相关地址">写上你想写的字</a>3)在新窗口打开连接:<a href="相关地址" target="_blank">写上要写的字</a>消除连接的下划线在新窗口打开连接:<a href="相关地址" style="text-decoration:none" target="_blank">写上你想写的字</a>4)移动字体(走马灯):<marquee>写上你想写的字</marquee>5)字体加粗:<b>写上你想写的字</b>6)字体斜体:<i>写上你想写的字</i>7)字体下划线: <u>写上你想写的字</u>8)字体删除线: <s>写上你想写的字</s>9)字体加大: <big>写上你想写的字</big>10)字体控制大小:<h1>写上你想写的字</h1> (其中字体大小可从h1-h5,h1最大,h5最小)11)更改字体颜色:<font color="#value">写上你想写的字</font>(其中value值在000000与ffffff(16位进制)之间12)消除连接的下划线:<a href="相关地址" style="text-decoration:none">写上你想写的字</a>13)贴音乐:<embed src=音乐地址width=300 height=45 type=audio/mpeg autostart="false">14)贴flash: <embed src="flash地址" width="宽度" height="高度">15)贴影视文件:<img dynsrc="文件地址" width="宽度" height="高度" start=mouseover>16)换行:<br>17)段落:<p>段落</p>18)原始文字样式:<pre>正文</pre>19)换帖子背景:<body background="背景图片地址">20)固定帖子背景不随滚动条滚动:<body background="背景图片地址" body bgproperties=fixed>21)定制帖子背景颜色:<body bgcolor="#value">(value值见10)22)帖子背景音乐:<bgsound="背景音乐地址" loop=infinite>23)贴网页:<iframe src="相关地址" width="宽度" height="高度"></iframe>/----------------------------------------HTML特效代码--------------------------------/1。
一、从右向左移代码<marquee direction=left>需要移动的文字</marquee>二、从左向右移代码<marquee direction=right>需要移动的文字</marquee>三、一圈一圈绕着移动代码<marquee behavior=scroll>需要移动的文字</marquee>四、只移动三次就停了代码<marquee loop=3 behavior=slide>需要移动的文字</marquee>五、移一步,停一停代码<marquee scrolldelay=500 scrollamount=100>需要移动的文字</marquee>六、左右来回移动代码<marquee behavior=alternate>需要移动的文字</marquee>七、忽隐忽现移动代码<marquee behavior="alternate"><marquee width="150" direction=right>需要移动的文字</marquee>八、从下向上移动代码<marquee direction=up><div align="center">需要移动的文字</div></marquee>九、从上向下移动代码<marquee direction=down><div align="center">需要移动的文字</div></marquee>十、垂直往复移动代码<marquee direction=up behavior=alternate><div align="center">需要移动的文字</font></div></marquee>十一、从左上向右下移动代码<marquee direction=right><marquee width=216 direction=down>需要移动的文字</marquee>十二、从右上向左下移动代码<marquee direction=left><marquee direction=down>需要移动的文字</marquee>十三、从左下向右上移动代码<marquee direction=right><marquee direction=up>需要移动的文字</marquee>十四、从右下向左上移动代码<marquee direction=left><marquee direction=up>需要移动的文字</marquee>十五、水平相反移动代码<p align=center> <marquee width="216px">需要移动的文字</marquee><marquee width="216px" direction=right>需要移动的文字</marquee></p>十六、左右两边向中间移动代码<p align=center><marquee style="width:216px;" direction=right>需要移动的文字</marquee><marquee style="width:216px;"direction=left>需要移动的文字</marquee></p>十七、左右两边向中间来回移动代码<MARQUEE scrollAmount=3 behavior=alternate width="40%">左右向中间来回移动</MARQUEE><MARQUEE scrollAmount=3 direction=rightbehavior=alternate width="40%">动移回来间中向右左</MARQUEE>十八、从上下向中间移动代码<p></p><center><marquee width=288 direction=down scrollAmount=2 height=50><center>需要移动的文字</center></marquee><center><marquee width=288 direction=up scrollAmount=2 height=50><center>需要移动的文字</center></marquee></center></center><p></p>十九、从中间向上下移动代码<p></p><center><marquee width=288 direction=up scrollAmount=2 height=50><center>需要移动的文字</center></marquee><center><marquee width=288 direction=down scrollAmount=2 height=50><center>需要移动的文字</center></marquee></center></center><p> </p></marquee>二十、上下向中间来回移动代码<MARQUEE scrollAmount=1 direction=down behavior=alternate height=50><DIV align=center>上下向中间来回移动</DIV></MARQUEE><MARQUEE scrollAmount=1 direction=up behavior=alternate height=50><DIV align=center>上下向中间来回移动</DIV></MARQUEE>二十一、上下交替移动代码<marquee direction=up behavior=alternate width=45 height=160><center>需</center></marquee><marquee direction=upbehavior=alternate width=45><center>要</center></marquee><marquee direction=up behavior=alternate width=45height=160><center>移</center></marquee><marquee direction=up behavior=alternate width=45><center>动</center></marquee><marquee direction=up behavior=alternate width=45 height=160><center>的</center></marquee><marqueedirection=up behavior=alternate width=45><center>文</center></marquee></marquee><marquee direction=up behavior=alternatewidth=45 height=160><center>字</center></marquee>二十二、移动后消失代码<marquee style="width: 288px; height: 120px" scrollAmount=5direction=up><center><div><marquee direction=upbehavior=alternate width=30 height=100><center>需</center></marquee><marquee direction=up behavior=alternate width=30height=110><center>移</center></marquee><marquee direction=up behavior=alternate width=30 height=100><center>要</center></marquee><marquee direction=up behavior=alternate width=30 height=110><center>动</center></marquee><marqueedirection=up behavior=alternate width=30 height=100><center>的</center></marquee><marquee direction=up behavior=alternatewidth=30 height=110><center>字</center></marquee><marquee direction=up behavior=alternate width=30 height=100><center>文</center></marquee></div></center></marquee>二十三、波浪式移动代码<div align=center><marquee width=288filter: wave(add=0,lightstrength=50,strength=3,freq=2,phrase=10); scrollAmount=5 direction=up behavior=alternate><div align=center><marquee scrollAmount=3 behavior=altrnatewidth=216><div align=center>需要移动的文字</div></marquee></div></marquee></div>二十四、往复波浪式移动代码<marquee width=288 filter: wave(add=0,lightstrength=50,strength=3,freq=2,phrase=10); scrollAmount=5 direction=upbehavior=alternate><marquee scrollAmount=3 behavior=alternate width=288>需要移动的文字</marquee></marquee>二十五、交替往复波浪式移动代码<marquee width=436 scrollAmount=5 direction=right behavior=alternate><marquee direction=up behavior=alternate width=50height=200 align="middle">需</marquee><marquee direction=up behavior=alternate width=50 height=150>的</marquee><marqueedirection=up behavior=alternate width=50 height=200>要</marquee><marquee direction=up behavior=alternate width=50 height=150>文</marquee><marquee direction=up behavior=alternate width=50 height=200>移</marquee><marquee direction=up behavior=alternatewidth=50 height=150>字</marquee><marquee direction=up behavior=alternate width=50 height=200>动</marquee></marquee>二十六、S型移动代码<marquee behavior=alternate direction=up scrollamount=2 scrolldelay=65 height=120 style="Text-align;filter:wave(add=0,phase=1, freq=1,strength=50,color=.ffffff)"><center>需要移动的文字</center></marquee>二十七、多层多式复合移动代码<table bgcolor="#ffffff"> <tr><td width="1" valign="top" > <marquee direction="down" behavior="alternate" scrollamount=1height="120"> <marquee direction="right" scrollamount=4 behavior="alternate" width="288">需要移动的文字</marquee> </marquee></td> <td width="288"> <marquee behavior=alternate direction=up scrollamount=2 scrolldelay=65 height="120" width="288"style="Text-align;filter:wave(add=1,phase=4, freq=1,strength=50)"><center>需要移动的文字</center></marquee></td></tr></table>二十八、文字竖排渐出移动代码<div align=center><marquee scrollAmount=1 scrollDelay=100 behavior=slide loop=1 width=290 height=180><marquee style="line-height: 120%; writing-mode: tb-rl" scrollAmount=1 scrollDelay=100 direction=up width=290 height=180><p align=center>需要移动的字文<br>.<br>.<br>.<br>需<br>要<br>移<br>动<br>的<br>文<br>字<br>.<br>.<br>.</p></marquee></marquee></div>二十九、文字穿梭移动代码<marquee scrollAmount=2 width=30 height=20>文 文</marquee> <marqueescrollAmount=2 width=30 height=20>字 字</marquee> <marquee scrollAmount=2width=30 height=20>穿 穿</marquee> <marquee scrollAmount=2 width=30 height=20>梭 梭</marquee> 附注各主要参数的含义:align:是设定活动对象(图片或文字)的位置。