网页代码与DW常见问题

1.如何使一个弹出窗口最大化?
<script>
self.moveTo(0,0)
self.resizeTo(screen.availwidath,screen.availHeight)</script>
2.怎样用图片来关闭窗口?
<a href="javasoript:window.
colse()"><imgheight=20 width=20 alt="    
"src="close.gif"border=0></a>
3.怎样禁止通过鼠标右键查看网页源代码?
<scritp language=javascript>
function click()
{if (event.button==2) {alert('你好,欢
迎光临 ') }}document.onmousedown=click
</script>
4.怎样自动定时跳转到新的页面?
<meta http-equiv="refresh"
content="4"; url=http://自己的 url">
5.怎样自动显示最后更新的日期?
<script>
document.write("         :
"+document.lastmodified+"<p>")
</script>
6.怎样使页面全屏显示?
<form>
<input typt="button"name="fullscree
n"value="全屏显示" onclick="window.
open(document.location,'big','fulls
creen=yes')"></form>
7.怎样使鼠标完全被封锁,屏蔽鼠标右键和网页文字?
<body oncontextmenu="return false"
ondragstart="return false" onselec-
tstart="return false">
8.怎样通过按钮来查看网页源代码?
<input type="button" vlaue="查看源代
码"onclick='window.location="view-
source;"= window.
location.href' name="buttont">
9.如何在网页中应用可以自动更新时间的效果?
<script>document.write(document.
lastmodified)</script>
10.怎样实现页面中的前进和后退?
<input typt="submit" name="submit"
value=" 前进 " onclick=history.go(1)>
<input type="submit" name=submit2"
value=" 后退 " onclick=history.go(-1)>
11.将网页设为首页的代码是什么?
<a href="#" onclick="this.style.beha
vior='url(#default#homepage)';this.
sethomepage('http://www.yourdomain.
com')> 设为首页 </a>
12.去除浏览器滚动条的代码是什么?
<body scroll=no>
13.有些网页中文字的超链接不会显示底线,这是怎么制作出来的?
<style>
<!--
A { text-decoration: none }
-->
</style>
14.如何定义网页语言(字符集)?
<meta http-equiv="content type"
content="text/html;charset=gb2312">
15.怎么防止别人把你的网页放到自己的框架里?
<script language="javascript">
if (self!=top) window.top.location.
replace(self.location);
</script>
16.如何在网页中加入E-mail链接并显示预定的主题?
<a href=mailto:husong@huxinyu.cn?
subject=hello>
17.怎样让背景图像不滚动?
<BODY backgroud="cnshell.gif" bgqro-
perties=
"fixed">
18.怎样使背景图像不平铺?
<style typt="text/css">
<!--
body { background-image: url(image/
bg.gif);
background-repeat: no-repeat)
-->
</style>
19.怎样定义网页的关键字?
<meta name="keywords" content="html",d
reamweaver,flash,css">
<meta name="keywords" content="dream-
weaver,
dreamweaver,dreamweaver">
20.如何链接网页的对象?
<a name="#1"></a>
而要链接到以上设置的部分,可以进行如下编制。
<a href="index.htm#t1">t1</a>
21.怎样为不支持框架结构的浏览器指定内容?
<body>
<noframes>
本网页是框架结构,请下载新的浏览器
</noframes>
</body>
22.怎样删除表格边框?
<body><table border="0" width="100%">
<tr>
<td width="100%"></td></tr>
</table></body>
23.如何隐藏在状态里出现的LINK信息?
<a href="http://www.yufeng21.com"
onmouse-
over="window.status=''none'';return
true">test</a>
24.怎样在网页中添加多媒体文体?
<embed src="tt.ram" autostart="true"
loop="2" width="80" height="30">
25.如何在网页中添加电子邮件表单提交?
<form method="post" action="mailto:
yourmail@
mail.com" enctype="text/plain">
26.怎样在网页中添加最后修改日期?
<script language="javascript">
document.write("最后修改日期"+docum-
ent.last-
modified);
</script>
27.如何清除页面中的框架结构?
<a href="http://www.yourdomain.com"
target=
"_top">链接</a>
28.怎样使浏览者忽视缓冲页面?
<meta http-equev="pragma" content=
"no-cache">
29.如何为页面制作幻灯片效果?
<meta http-equiv="refresh" content="6;
url=x.htm">a
30.如何改变表单submit按钮上的文字?
<input type="submit" value="submit"
name="b1">
31.怎样加快页面图片的下载速度?
<img src="cn.jpg" width=0 height=0>
32.如何自动弹出对话框?
<script language="javascript">alert("
弹出内容")</script>
33.如何在页面中利用单击来关闭浏览窗口?
<a href="javascript:window.colse()">
       </a>
34.<!DOCTYPE>代码是什么意思?
<!doctype htmlpublic'-//w3c//dtd html
4.01//en'>
35.如何在网址前面添加小图标?
<link rel="shortcut icon" href="http://
www.yourdomain.com/       ">
36.在分辨率为800*600的显示器中,如何不让网页出现水平滚动条?
<body leftmargin="0" topmargin="0">
37.使用<iframe>标记在网页中嵌入网页应该怎样操作?
<iframe src="iframe.html" name="test"
align="mtddle" width="300" height="100"
marginwidth="1" marginheight="1" frame-
border="1" scrolling="yes">
38.如何使滚动条出现在页面的左侧?
<html dir="rtl">
39.alt和title一身是都是提示性语言标记属性,它们之间有什么区别吗?
<p title="给链接文字提示"> 文字</p>
<a href="#" title="给链接文字提示"> 
</a>
<img src="图片.gif" alt="给图片提示">
40.怎样使用背景音乐的相关标记?
<embed src="001.mid" width=145 height=60
autostart=true loop=true hidden="true">
41.visibility和display属性的区别是什么?
<div style="width:100px;height:20px"id=id
vl>第一行</div> 第二行<inputtype=buttono
nclick=divl.style.display='none' val
ue=display><inputtype=buttononclick
=divl.style.visibility='hidden' value=
visibility>
42.如何使DIV居中?
body {text-align; center;} #center { ma-
rgin-right: auto; margin-left auto;}
43.如何使图片在DIV中垂直居中?
body{background: url(http://www.w3cn.
org/style/001/logo_w3cn_194×97. gif)
#fff no-repeat center;}

 

 

 

 

 


 

posted @ 2012-04-20 18:08  珍爱贝贝1314  阅读(650)  评论(0编辑  收藏  举报