| 论坛注册| 加入收藏 | 设为首页| RSS
Google
您当前的位置:首页 > Linux频道 > Linux开发区 > WEB开发

网页技巧二十例

时间:2006-06-06 13:37:19  来源:Linux联盟  作者:上上智

1. 如何在网页中加入注释 neyLinux联盟
◆代码:< !-- 这是注释 --> neyLinux联盟
2. 如何在网页中加入email链接并显示预定的主题 neyLinux联盟
◆代码:< a href="mailtyourmail@xxx.xxx?subject=你好">send mail< /a>  neyLinux联盟
 neyLinux联盟

3. 如何制作电子邮件表单 neyLinux联盟
◆在<form>中输入action="youremail@xxx.xxx" ,提交采用post方法。 neyLinux联盟

4. 如何避免别人将你的网页放入他的框架(frame)中 neyLinux联盟
◆在源代码中的<head>…< /head>之间加入如下代码: neyLinux联盟
<script language="java script"><!-- neyLinux联盟
if (self!=top){top.location=self.location;} neyLinux联盟
-->< /script> neyLinux联盟

5. 如何自动加入最后修改日期 neyLinux联盟
◆在源代码中的<body>…< /body>之间加入如下代码: neyLinux联盟
< script language="java script"><!-- neyLinux联盟
document.write("last updated:"+document.lastmodified); neyLinux联盟
-->< /script> neyLinux联盟

6. 如何让背景图象不滚动 neyLinux联盟
◆代码:<body background="bg.gif" bgproperties="fixed" > neyLinux联盟
◆在dreamweaver中用「text」-「custom style」-「edit style sheet」-「new」-redefine html tag中选择body,然后在background中的attachment里选fixed neyLinux联盟

7. 如何将网页定时关闭 neyLinux联盟
◆在源代码中的<body>后面加入如下代码: neyLinux联盟
< script language="java script"> <!-- neyLinux联盟
settimeout(''window.close();'', 60000); neyLinux联盟
--> < /script> neyLinux联盟
在代码中的60000表示1分钟,它是以毫秒为单位的。 neyLinux联盟

8. 将网页加入收藏夹 neyLinux联盟
◆请使用如下代码:(注意标点符号) neyLinux联盟
< a href=''#'' onclick="window.external.addfavorite(''www.yjjt.com.cn>http://www.yjjt.com.cn&#39;;,''延津交通网'')" target="_top">将本站加入收藏夹< /a> neyLinux联盟

9. 如何定义网页的关键字(keywords) neyLinux联盟
◆格式如下: neyLinux联盟
< meta name="keywords" content="dreamweaver,flash,fireworks"> neyLinux联盟
content中的即为关键字,用逗号隔开 neyLinux联盟
◆在dreamweaver中用「insert」-「head」-keywords命令 neyLinux联盟

10. 如何设置命令来关闭打开的窗口 neyLinux联盟
◆在源代码中加入如下代码: neyLinux联盟
< a href="/" onclick="java script:window.close(); return false;">关闭窗口< /a> neyLinux联盟

11. 如何在网页中加入书签,在页面内任意跳转 neyLinux联盟
◆在源代码中需要插入书签的地方输入,在调用的地方输入top,其中的top是你设定的书签名字。 neyLinux联盟
◆在dreamweaver中用菜单的「insert」-「name anchor」命令插入书签,调用时,在link中输入#top,top为书签名。 neyLinux联盟

12. 如何为不支持框架的浏览器指定内容 neyLinux联盟
◆在源代码中加入下面代码: neyLinux联盟
< body><noframes>本网页有框架结构,请下载新的浏览器观看< /noframes></ body> neyLinux联盟

13. 如何在网页中加入单个或几个空格 neyLinux联盟
◆在源代码中输入 ,每个 之间请用空格分开。 neyLinux联盟
◆在dreamweaver中用<ctrl>+<shift>+<space>插入空格或任输几个字符,然后将其色彩设成背景的色彩! neyLinux联盟

14. 如何在网页中加入书签,在多个页面之间任意跳转 neyLinux联盟
◆方法与上面类似,不过做链接时要在书签名前加上网页文件名,如:other.htm#top,这样一来就会跳转到other.htm页面中的top书签处。 neyLinux联盟

15. 如何使表格(table)没有边框线 neyLinux联盟
◆将表格的边框属性:border="0" neyLinux联盟

16. 如何隐藏状态栏里出现的link信息 neyLinux联盟
◆请使用如下代码: neyLinux联盟
< a href="http://www.yjjt.com.cn";;;;;;; on mouseover="window.status=''none'';return true">南华人社区< /a> neyLinux联盟

17. 如何定时载入另一个网页内容 neyLinux联盟
◆在源代码中的<head>…< /head> 加入如下代码: neyLinux联盟
< meta http-equiv="refresh" content="40;url=http://www.yjjt.com.cn"> neyLinux联盟
40秒后将http://www.yjjt.com.cn所在的网页 neyLinux联盟

18. 如何为网页设置背景音乐 neyLinux联盟
◆代码:<embed src="music.mid" autostart="true" loop="2" width="80" height="30" > neyLinux联盟
src:音乐文件的路径及文件名; neyLinux联盟
autostart:true为音乐文件上传完后自动开始播放,默认为false(否) neyLinux联盟
loop:true为无限次重播,false为不重播,某一具体值(整数)为重播多少次 neyLinux联盟
volume:取值范围为"0-100",设置音量,默认为系统本身的音量 neyLinux联盟
starttime:"分:秒",设置歌曲开始播放的时间,如,starttime="00:10",从第10开始播放 neyLinux联盟
endtime: "分:秒",设置歌曲结束播放的时间 neyLinux联盟
width:控制面板的宽 neyLinux联盟
height:控制面板的高 neyLinux联盟
controls:控制面板的外观 neyLinux联盟
controls="console/smallconsole/playbutton/pausebutton/stopbutton/volumelever" neyLinux联盟
console:正常大小的面板 neyLinux联盟
smallconsole:较小的面板 neyLinux联盟
playbutton:显示播放按钮 neyLinux联盟
pausebutton:显示暂停按钮 zneyLinux联盟
stopbutton:显示停止按钮 neyLinux联盟
volumelever:显示音量调节按钮 neyLinux联盟
hidden:为true时可以隐藏面板 neyLinux联盟

19. 如何去掉链接的下划线 neyLinux联盟
◆在源代码中的<head>…</head>之间输入如下代码: neyLinux联盟
<style type="text/css"> <!-- neyLinux联盟
a { text-decoration: none} neyLinux联盟
--> < /style> neyLinux联盟
◆在dreamweaver中用「text」-「custom style」-「edit style sheet」-「new」-redefine html tag中选择a,然后在decoration中选中none neyLinux联盟

20. timeline中的layer走曲线 neyLinux联盟
◆要使得timeline中的layer走曲线,你得先让他走出直线来,然后在最后一frame和第一frame中间的任何一frame上点右键,可以看到有个 add keyframe ,点一下,然后把你的layer移动到你要的位置,dw会自动生成曲线! neyLinux联盟
 neyLinux联盟
neyLinux联盟

来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
    无相关信息
栏目更新
栏目热门