感谢[银河网络]提供空间
 您现在的位置:首页 综合教程 >> 网页教程 >> 正文
 
网页代码常用小技巧总结
本站永久域名:HTTP://WWW.51EPSJ.COM   加入日期:2006-11-11 20:58:21   点击数:

如内容超出单元格,则隐藏
style="TABLE-LAYOUT: fixed"

弹出窗口总是在最上面: <body onblur="this.focus();">
不要滚动条? 让竖条没有: <body style='overflow:scroll;overflow-y:hidden'> </body>
横条没有: <body style='overflow:scroll;overflow-x:hidden'> </body>
两个都去掉?更简单了 <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="text/plain"> <input type=submit> </form>
在打开的子窗口刷新父窗口的代码里如何写? window.opener.location.reload()
如何设定打开页面的大小 <body onload="top.resizeTo(300,200);">
在页面中如何加入不是满铺的背景图片,拉动页面时背景图不动 <html><head> <STYLE> body {background-image:url(logo.gif); background-repeat:no-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 :十字标 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("SERVER_PORT")%>
服务器时间<%=now%> IIS
版本<%=Request.ServerVariables"SERVER_SOFTWARE")%>
脚本超时时间<%=Server.ScriptTimeout%>
本文件路径<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%>
服务器CPU数量<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
服务器解译引擎<%=ScriptEngine & "/"& ScriptEngineMajorVersion &"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
服务器操作系统<%=Request.ServerVariables("OS")%>

文本竖排方式
<style type="text/css">
<!--
.shupai {Writing-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}
网上邻居
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="javascript">
<!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=20
}
//-->
</SCRIPT>
  2、把如下代码加入<body>区域中:
<img src="2.gif" style="filter:alpha(opacity=20)"
onMouseOver="makevisible(this,0)"
onMouseOut="makevisible(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.files/news.htm" frameBorder=0></iframe>

隐藏滚动条
<body style="overflow-x:hidden;overflow-y:hidden"

CSS文字阴影(定义在<TD>中)
.abc{
FILTER: dropshadow(color=#666666, offx=1, offy=1, positive=1); FONT-FAMILY: "宋体"; FONT-SIZE: 9pt;COLOR: #ffffff;
}

列表/菜单
onchange="location=this.options[this.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="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.ServerVariables("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.open('')"

取得IP
userip = 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)
if(len(str)>len)
str = left(str,len) + "..."
end if
formatStr = str
end function

接收表单
If Ucase(Request.ServerVariables("REQUEST_METHOD")) = "POST" then
end if


图片宽度
<script language="javascript">
<!--
var flag=false;
function DrawImage(ckp){
var image=new Image();
image.src=ckp.src;
if(image.width>0 && image.height>0)
{flag=true;
if(image.width>120){
ckp.width=120;
}else{
ckp.width=image.width;
}
ckp.alt=image.width+"×"+image.height;
}
}
//-->
</script>
I'll be Back 22:18:06
<img src="<%=formPath%>/<%=rs("photoname")%>" border="0" onload="javascript:DrawImage(this);">

跳转
<meta http-equiv=refresh content='0; url=/distributor/distributor.aspx'>

 溢出栏的设制
visible:超出的部分照样显示;
hidden:超出的部分隐藏;
scrool:不管有否超出,都显示滚动条;
auto:有超出时才出现滚动条;

onMouseOver:鼠标移到目标上;
onMouseUp:按下鼠标再放开左键时;
onMouseOut:鼠标移开时;
onMouseDown:按下鼠标时(不需要放开左键);
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();
窗口还原
function restore(){
window.moveTo(8,8);
window.resizeTo(screen.width-24,screen.availHeight-24);
}

head区是指首页HTML代码的<head>和</head>之间的内容。
必须加入的标签

1.公司版权注释
<!--- The site is designed by Maketown,Inc 06/2000 --->

2.网页显示字符集
简体中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
繁体中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=BIG5">
英 语:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

3.网页制作者信息
<META name="author" content="webmaster@maketown.com">

4.网站简介
<META NAME="DESCRIPTION" CONTENT="xxxxxxxxxxxxxxxxxxxxxxxxxx">

5.搜索关键字
<META NAME="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,">

6.网页的css规范
<LINK href="style/style.css" rel="stylesheet" type="text/css">
(参见目录及命名规范)

7.网页标题
<title>xxxxxxxxxxxxxxxxxx</title>

.可以选择加入的标签

1.设定网页的到期时间。一旦网页过期,必须到服务器上重新调阅。
<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">

4.自动跳转。
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.yahoo.com">
5指时间停留5秒。

5.网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。
<META NAME="robots" CONTENT="none">
CONTENT的参数有all,none,index,noindex,follow,nofollow。默认是all。

6.收藏夹图标
<link rel = "Shortcut Icon" href="favicon.ico">

所有的javascript的调用尽量采取外部调用.
<SCRIPT LANGUAGE="javascript" SRC="script/xxxxx.js"></SCRIPT>

附<body>标签:
<body>标签不属于head区,这里强调一下,为了保证浏览器的兼容性,必须设置页面背景<body bgcolor="#FFFFFF">

flash透明
在flash的源代码中加上:<param name="wmode" value="transparent">

表格透明
style="FILTER: alpha(opacity=72)"

此文章共有21 2

 
编辑:E品视觉 作者:佚名 来源:转载
欢迎企业及个人投稿,投稿请Email至:jx_hcs@163.com
打印 关闭
2006创意设计奖-间接设计类
[栏目所属:平面艺术]
[加入时间:2007-1-9 12:02:01]
国外广告设计欣赏-勾起你欲望的食品广告
[栏目所属:平面艺术]
[加入时间:2007-1-9 12:00:14]
电影《基督诞生记》海报设计
[栏目所属:平面艺术]
[加入时间:2007-1-9 11:58:11]
国外设计欣赏-Comedy Central Germany 广告设计
[栏目所属:平面艺术]
[加入时间:2007-1-9 11:54:40]
国外广告设计欣赏-Toyota Genuine Parts广告设计
[栏目所属:平面艺术]
[加入时间:2007-1-9 11:50:44]
Gortz 小小鞋广告
[栏目所属:平面艺术]
[加入时间:2006-12-27 18:08:18]
国外海报设计欣赏-秘密电影海报设计
[栏目所属:平面艺术]
[加入时间:2006-12-27 17:58:20]
熟女林志玲
[栏目所属:时尚摄影]
[加入时间:2006-12-26 19:11:58]
极致诱惑洛佩兹香水广告
[栏目所属:平面艺术]
[加入时间:2006-12-26 19:09:31]
2006广告创意风暴
[栏目所属:平面艺术]
[加入时间:2006-12-26 19:03:06]
相关联接
在线评论
共有评论篇 查看评论
昵称:
* 请各位网友遵纪守法并注意语言文明。
 
免责声明:
站内会员言论仅代表个人观点,并不代表本站同意其说法或描述,本站不承担由此引起的法律责任。所有资料源于作者发布或网友推荐收集整理而来,仅供学习使用,版权归原作者所有,如有侵权,请您联系我们,我们将尽快更正!
转载要求:
作者及来源信息必需保留。转载之图片、文件,链接请不要盗链到本站,且不准打上各自站点的水印。
 
站长简介 | 在线留言 | 广告投放 | 网站地图 | 友情链接
我要一品视觉
QQ:7360144[设计自我→新] QQ:272876225[舌ヒ闪] 本站带宽与空间支持:银河网络 视觉设计师交流群:5770736(群1) 43857887(群2)