网页制作常用代码备查_第1页
网页制作常用代码备查_第2页
网页制作常用代码备查_第3页
网页制作常用代码备查_第4页
全文预览已结束

下载本文档

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

文档简介

1、网页制作常用代码备查为了避免有时用起来找不到,我将网页编辑中最常用到的几个简单代码放在这里备查代码: 定制字体为“宋体12px”并去掉超链接的下横线  -  /在<HEAD>和</HEAD>之间插入   <style type="text/css">  BODY    FONT-FAMILY: "宋体","tahoma" FONT-SIZE: 12px  TH FONT-FAMILY: "宋体", "

2、tahoma" FONT-SIZE: 12px  TD FONT-FAMILY: "宋体", "tahoma" FONT-SIZE: 12px  <!-  a text-decoration:none  a:hover color: red;text-decoration:none  ->  </style>  -  加入收藏(页面)  <script language>  <!-  if (n

3、avigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)    document.write("<U><SPAN style='color:blue;cursor:hand;' onclick='window.external.AddFavorite(location.href, document.title);'>将本页添加到收藏夹</SPAN>

4、;</U>");    /->  </script>   加入收藏(网站)  -  <a href="javascript:window.external.AddFavorite('', '西部教育网')">将本站加入收藏夹</a>  设为首页  -  <a href=# onClick="this.style.behavior='url(#default#homep

5、age)'this.setHomePage  ('');">将本站设为首页</a>  自动显示当前日期<式样: 2002年2月18日(星期一) >  -  <script language="javascript">  var  today=new Date();var strDate=(" "+today.getYear()+"年"+(today.getMonth()+1)+"月"

6、;+today.getDate()+"日");var n_day=today.getDay();switch(n_day)  case 0:  strDate=strDate+"(星期日)"  break;case 1:  strDate=strDate+"(星期一)"  break;case 2:  strDate=strDate+"(星期二)"  break;case 3:  strDate=strDate+"(星期三)&

7、quot;  break;case 4:  strDate=strDate+"(星期四)"  break;case 5:  strDate=strDate+"(星期五)"  break;case 6:  strDate=strDate+"(星期六)"  break;case 7:  strDate=strDate+"(星期日)"  break;document.write(strDate);  </script

8、>    自动动态显示当前时间<式样:=>午夜12:23:45    -  <script>  function tick()  var hours, minutes, seconds, xfile;  var intHours, intMinutes, intSeconds;  var today;  today = new Date();  intHours = today.getHours();  intMinutes = today.ge

9、tMinutes();  intSeconds = today.getSeconds();  if (intHours = 0)  hours = "12:"  xfile = "午夜"   else if (intHours < 12)  hours = intHours+":"  xfile = "上午"   else if (intHours = 12)  hours = "12:"  

10、;xfile = "正午"   else  intHours = intHours - 12  hours = intHours + ":"  xfile = "下午"    if (intMinutes < 10)  minutes = "0"+intMinutes+":"   else  minutes = intMinutes+":"    if (int

11、Seconds < 10)  seconds = "0"+intSeconds+" "   else  seconds = intSeconds+" "    timeString = xfile+hours+minutes+seconds;  Clock.innerHTML = timeString;  window.setTimeout("tick();", 100);    window.onload = tick

12、;  </script>  <div id="Clock" align="center" style="font-size: 12; color:#FFFF00"></div>   自动显示当前日期和时间<式样:2002年2月18日 星期一 0:19am >  -  <script>  <!-  today=new Date();  var hours = today.getHours();

13、  var minutes = today.getMinutes();  var seconds = today.getSeconds();  var timevalue = "<FONT COLOR=#FFFF00>" + (hours >12) ? hours -12 :hours); timevalue += (minutes < 10) ? "<BLINK><FONT COLOR=#FFFF00>:</FONT></BLINK>0" : &quo

14、t;<BLINK><FONT COLOR=#FFFF00>:</FONT></BLINK>") + minutes+"</FONT></FONT>"  timevalue += (hours >= 12) ? "<FONT COLOR=#FFFF00>pm</FONT>" : "<FONT COLOR=#FFFF00>am</FONT>"  function initArray()

15、  this.length=initArray.arguments.length  for(var i=0;i<this.length;i+)  thisi+1=initArray.arguments  var d=new initArray("<font color=#FFFF00>星期日","<font color=#FFFF00>星期一","<font color=#FFFF00>星期二","<font color=#FFFF00&

16、gt;星期三","<font color=#FFFF00>星期四","<font color=#FFFF00>星期五","<font color=#FFFF00>星期六"); document.write("<font color=#FFFF00><font color=#FFFF00>",today.getYear(),"<font color=#FFFF00>年","<font color=#FFFF00>",

温馨提示

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

评论

0/150

提交评论