Html网页代码常用小技巧总结续,网页制作学习_第1页
Html网页代码常用小技巧总结续,网页制作学习_第2页
Html网页代码常用小技巧总结续,网页制作学习_第3页
Html网页代码常用小技巧总结续,网页制作学习_第4页
Html网页代码常用小技巧总结续,网页制作学习_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Html:网页代码常用小技巧总结续,网页制作学习· 如内容超出单元格,则隐藏style="TABLE-LAYOUT: fixed"让弹出窗口总是在最上面: <body onblur="this.focus();">不要滚动条? 让竖条没有: <body style=overflow:scroll;overflow-y:hidden> </body>让横条没有: <body style=overflow:scroll;overflow-x:hidden> </body>两个都去掉?更简单

2、了 <body scroll="no"> </body>怎样去掉图片链接点击后,图片周围的虚线? <a href="#" onFocus="this.blur()"><img src="logo.jpg" border=0></a>电子邮件处理提交表单 <form name="form1" method="post" action="mailto:*.com" enctype="t

3、ext/plain"> <input type=submit> </form>在打开的子窗口刷新父窗口的代码里怎么写? window.opener.location.reload()怎么设定打开页面的大小 <body onload="top.resizeTo(300,200);">在页面中怎么加入不是满铺的背景图片,拉动页面时背景图不动 <html><head> <STYLE> bodybackground-image:url(logo.gif); background-repeat:n

4、o-repeat; background-position:center </STYLE> </head> <body bgproperties="fixed" > </body> </html>各种样式的光标 auto :标准光标default :标准箭头hand :手形光标wait :等待光标text :I形光标vertical-text :水平I形光标no-drop :不可拖动光标not-allowed :无效光标help :?帮助光标all-scroll :三角方向标move :移动标crosshair :

5、十字标 e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize本机ip<%=request.servervariables("remote_addr")%>服务器名<%=Request.ServerVariables("SERVER_NAME")%>服务器IP<%=Request.ServerVariables("LOCAL_ADDR")%>服务器端口<%=Request.ServerVariables("S

6、ERVER_PORT")%>服务器时间<%=now%> IIS版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>脚本超时时间<%=Server.ScriptTimeout%>本文件路径<%=server.mappath(Request.ServerVariables("SCRIPT_NAME")%>服务器CPU数量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>

7、;服务器解译引擎<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>服务器操作系统<%=Request.ServerVariables("OS")%>文本竖排方式<style type="text/css"><!-.shupai Writin

8、g-mode:tb-rl-></style>超链接去虚线边框在链接中加上onfocus="this.blur()"网页搜索关键字 头里插入<META NAME="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,">收藏夹图标<link rel = "Shortcut Icon" href="favicon.ico">我的计算机file:/:20D04FE0-3AEA-1069-A2D8-08002B30309D网上

9、邻居file:/:%7B208D2C60-3AEA-1069-A2D7-08002B30309D%7D我的文件file:/:%7B450D8FBA-AD25-11D0-98A8-0800361B1103%7D控制面板file:/:20D04FE0-3AEA-1069-A2D8-08002B30309D/:21EC2020-3AEA-1069-A2DD-08002B30309D 回收站file:/:%7B645FF040-5081-101B-9F08-00AA002F954E%7D鼠标控制图片隐现效果把如下代码加入body区域中:<SCRIPT language="javascr

10、ipt"><!-function makevisible(cur,which)if (which=0)cur.filters.alpha.opacity=100elsecur.filters.alpha.opacity=20/-></SCRIPT>2、把如下代码加入body区域中:<img src="2.gif" style="filter:alpha(opacity=20)"onMouseOver="makevisible(this,0)"onMouseOut="makevis

11、ible(this,1)">禁止图片下载<A HREF="javascript:void(0)" onMouseover="alert(对不起,此图片不能下载!)"><IMG SRC="2.gif" Align="center" Border="0" width="99" height="50"></A>页嵌页<iframe width=291 height=247 src="main.f

12、iles/news.htm" frameBorder=0></iframe>隐藏滚动条<body style="overflow-x:hidden;overflow-y:hidden"CSS文字阴影(定义在<TD>中).abcFILTER: dropshadow(color=#666666, offx=1, offy=1, positive=1); FONT-FAMILY: "宋体" FONT-SIZE: 9pt;COLOR: #ffffff;列表/菜单onchange="location=this

13、.optionsthis.selectedIndex.value"<iframe id="frm" src="k-xinwen.html" scrolling="no" width="314" height="179"></iframe><img src="xiangshang.jpg" onMouseOver="sf=setInterval(frm.scrollBy(0,-2),1)"onMouseOut=&quo

14、t;clearInterval(sf)" width="31" height="31"><img src="xiangxia.jpg" onMouseOver="sf=setInterval(frm.scrollBy(0,2),1)" onMouseOut="clearInterval(sf)" width="31" height="31" >reurl=server.htmlencode(request.ServerVaria

15、bles("HTTP_REFERER")服务器上怎么定义连接MM_www_STRING ="driver=Microsoft access Driver (*.mdb);dbq=" & server.mappath("./data/www.mdb")链接到response.redirect"login.asp"location.href="xx.asp"onClick="window.location=login.asp"onClick="window.op

16、en()"取得IPuserip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")sql="update feedbak set hit=hit+1 where id="&request("id")conn.execute(sql)截取字符是否加.function formatStr(str,len

17、)if(len(str)>len)str = left(str,len) + "."end ifformatStr = strend function接收表单If Ucase(Request.ServerVariables("REQUEST_METHOD") = "POST" then end if图片宽度<script language="javascript"><!-var flag=false;function DrawImage(ckp)var image=new Image();i

18、mage.src=ckp.src;if(image.width>0 && image.height>0)flag=true;if(image.width>120)ckp.width=120;elseckp.width=image.width;ckp.alt=image.width+"×"+image.height;/-></script>Ill be Back 22:18:06<img src="<%=formPath%>/<%=rs("photoname")

19、%>" border="0" onload="javascript:DrawImage(this);">跳转<meta http-equiv=refresh content=0; url=/distributor/distributor.aspx>溢出栏的设制visible:超出的部分照样显示;hidden:超出的部分隐藏;scrool:不管有否超出,都显示滚动条;auto:有超出时才出现滚动条;onMouseOver:鼠标移到目标上;onMouseUp:按下鼠标再放开左键时;onMouseOut:鼠标移开时;onMou

20、seDown:按下鼠标时(不必放开左键);onClink:点击时;onDblClick:双击时;onLoad:载入网页时;onUnload:离开页面时;onResize:当浏览者改动浏览窗口的大小时;onScroll:当浏览者拖动滚动条的时。CSS样式a:link:表示已链接;a:hover:表示鼠标移上链接时;a:active:表示链接激活时;a:visited:表示己点击过的链接。跳出对话框链接javascript:alert(lajflsjpjwg)后退:javascript:history.back(1)关闭窗口:javascript:window.close();窗口还原functi

21、on restore()window.moveTo(8,8);window.resizeTo(screen.width-24,screen.availHeight-24);head区是指首页HTML代码的<head>和</head>之间的内容。必须加入的标签<!- The site is designed by Maketown,Inc 06/2000 ->简体中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 繁体

22、中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=BIG5"> 英 语:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META name="author" content="webmaster"><META NAME="DESCRIPTION"

23、; CONTENT="xxxxxxxxxxxxxxxxxxxxxxxxxx"><META NAME="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,"><LINK href="style/style.css" rel="stylesheet" type="text/css">(参见目录及命名规范)<title>xxxxxxxxxxxxxxxxxx</title>.能选择加入的标签1

24、.设定网页的到期时间。一旦网页过期,必须到服务器上重新调阅。<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">2.禁止浏览器从本地机的缓存中调阅页面内容。<META HTTP-EQUIV="Pragma" CONTENT="no-cache">3.用来防止别人在框架里调用你的页面。<META HTTP-EQUIV="Window-target" CONTENT="_top&

25、quot;>4.自动跳转。<META HTTP-EQUIV="Refresh" CONTENT="5;URL="> 5指时间停留5秒。5.网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引,哪些页面不必索引。 <META NAME="robots" CONTENT="none">CONTENT的参数有all,none,index,noindex,follow,nofollow。默认是all。<link rel = "Shortcut Icon" href=

26、"favicon.ico">所有的javascript的调用尽量采取外部调用.<SCRIPT LANGUAGE="javascript" SRC="script/xxxxx.js"></SCRIPT>附<body>标签:<body>标签不属于head区,这里强调一下,为了确保浏览器的兼容性,必须设置页面背景<bodybgcolor="#FFFFFF">flash透明在flash的原始码中加上:<param name="wmode&qu

27、ot; value="transparent">表格透明style="FILTER: alpha(opacity=72)"网址前添加icon的方法1、上icon editor online制作一个图标。他会将做好的图标通过email即时发送给你。2、把这个命名为favicon.ico的图标放置在index.html同一个目录中。就能了。作一个图标文件,大小为16*16像素。文件扩展名为ico,然后上传到相应目录中。在HTML源文件“head/head”之间添加如下代码:Link Rel="SHORTCUT ICON" href=

28、"http:/图片的地址(注意和刚才的目录对应)"其中的“SHORTCUT ICON”即为该图标的名称。当然如果用户使用IE5或以上版本浏览时,就更简单了,只需将图片上传到网站根目录下,自动识别能在收藏夹中显示出你的图标<link rel="Bookmark" href="favicon.ico">状态栏连接说明<A HREF="链接到某处" onmouseOver="window.status=连接说明;return true;" onMouseOut="windo

29、w.status= ;">某某链接</a>链接说明<a href=“”Title=链接说明>禁止鼠标右键在<body>标签中加入 <body oncontextmenu="return false">DW里输入空格插入N个&nbsp;水平线<hr width="长度" size="高度" color="颜色代码" noshade> noshade为有无阴影表单电子邮件提交< form name="content&qu

30、ot; method="post" action="mailto:电子邮箱" >< /form>文本域名为Subject 为邮件的标题邮件链接制定Mailto:地址 ? Subject=邮件的标题 &bc=抄送 &bcc=密件抄送背景音乐<bgsound src=地址 loop="-1">禁止页面正文选取<body oncontextmenu="return false" ondragstart="return false" onselects

31、tart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()">消除ie6自动出现的图像工具栏,设置 GALLERYIMG属性为false或no .<IMG SRC="mypicture.jpg" HEIGHT

32、="100px" WIDTH="100px" GALLERYIMG="no">防止点击空链接时,页面往往重置到页首端。代码“javascript:void(null)”代替原来的“#”标记怎么避免别人把你的网页放在框架中<script language=“javascript”><!-if (self!=top)top.location=self.location; ->< /script>页面定时刷新<meta http-equiv="Refresh" conten

33、t="秒" >页面定时转向新的地址<meta http-equiv="refresh" content="秒;URL=url">显示日期<script language="javascript"><!-today=new Date();var week; var date;if(today.getDay()=0) week="星期日"if(today.getDay()=1) week="星期一"if(today.getDay()=2) we

34、ek="星期二"if(today.getDay()=3) week="星期三"if(today.getDay()=4) week="星期四"if(today.getDay()=5) week="星期五"if(today.getDay()=6) week="星期六"date=(today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日"+" "docu

35、ment.write("<span style=font-size: 9pt;>"+date+week+"</span>");/ -></script>设为首页<A href=# onclick="this.style.behavior=url(#default#homepage);this.setHomePage(url);">设为首页</A>添加收藏<A href="javascript:window.external.AddFavorite(url

36、,title)">收藏本站</A>文字滚动插入边框为0的1行1列的表格,在表格中输入文字,选中文字,按ctrl+t输入marquee direction="up", 回车即可让文字在表格区域内向上滚动。(right、down可用于让文字或图象向右及向下滚动,修改html原代码还能得到需要的滚动速度。表单验正<SCRIPT language=javascript>function checkform(theform)if(.value="")alert("姓名不能为空!");.focus();return false;if(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论