发新话题
打印

〖2006-1-29〗[推荐]常用HTML代码 HTML语言初学必备

〖2006-1-29〗[推荐]常用HTML代码 HTML语言初学必备

1.css定义超连接,

<style type="text/css">
<!--
A:link{text-decoration: none;color:black}
A:visited{TEXT-DECORATION: none;color:black}
A:active{TEXT-DECORATION: none}
A:hover{TEXT-DECORATION: underline overline;color:#414992}         
body {FONT-SIZE: 9pt}
   th {FONT-SIZE: 9pt}
   td {FONT-SIZE: 9pt}
   tr  {FONT-SIZE: 9pt}
-->
</style>

<style type="text/css">
<!--
A:link{text-decoration: underline;color:#003399}
A:visited{TEXT-DECORATION: underline;color:#003399}
A:active{TEXT-DECORATION: underline}
A:hover{TEXT-DECORATION: underline ;color:#ff3300}         
body {FONT-SIZE: 9pt}
   th {FONT-SIZE: 9pt}
   td {FONT-SIZE: 9pt}
   tr  {FONT-SIZE: 9pt}
table {font-size: 9pt}
-->
</style>

2.超连接单元格变色

A:visited{TEXT-DECORATION: none}
A:active{TEXT-DECORATION: none}
A:hover{TEXT-DECORATION: underline overline}
A:link{text-decoration: none;}
表格单元,在单元格的<td>标记里加上:onMouseOut="this.style.backgroundColor=\'\' "onMouseOver=this.style.backgroundColor=\'#E0E2ED\'就可以了
onMouseOut="this.style.border=\'0px solid #cccccc\';this.style.backgroundColor=\'\' "onMouseOver="this.style.border=\'1px solid #cccccc\';this.style.backgroundColor=\'#E0E2ED\'"

3.细表格边框

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="158" height="68">
    <tr>
      <td width="158" height="68"> </td>
    </tr>
  </table>

4.网页全屏显示

把如下代码加入<body>区域中
<SCRIPT LANGUAGE="javascript">
<!-- Begin
if (this.name!=\'fullscreen\'){
window.open(location.href,\'fullscreen\',\'fullscreen,scrollbars\')
}
// End -->
</script>
<a href="javascript:window.close(self)">返回正常效果显示</a>


5.表格虚线

使用CSS,新建一个Style,选择“Redefine HTML Tag”,在下拉菜单中选择“td”,在弹出对话框中的“Category”里选择“Border”,将Top、Left、Right、Bottom都设成1px,颜色设成你想要的边框的颜色。然后在“Style”下拉框里选择“Dashed”,点“OK”。这样所有的表格都变成虚线的了。
或:
<table><td style="border:dashed 1px #00000">test</td></table>


6.连接全屏

<a href="#" onClick="window.open(URL,\'\',\'fullscreen=1\')">Link</a>
通过连接可以打开一个全屏窗口


7.DW层的定位

用菜单插入层,不要用面板的。
主要就是不要设定层的left和right属性


8.css阴影滤镜

<div style="width:754;height:13;color:black;filter:dropshadow(color=white,offx=1,offy=1,positive=2);">  首页 关于本站 设计作品 </div>

<div style="width:75;height:1;color:black;filter:dropshadow(color=#cccccc,offx=1,offy=1,positive=2);" align="center"><font color="#414992"><a href="index.htm">首页</a></font></div>


9.关闭窗口

<a href="javascript:closewin();">关闭本页</a>
  <script language=javascript>
function closewin() {window.close(); return;}
</script>


0.图层的准确定位

在单元格里Insert/Layer,插入一个图层A(通过菜单插入的图层是相对定位),他的位置是跟着参照物改变的。接着图层A中插入一个图层B。这时你可移动图层B到任何位置。这时图层B的位置是绝对的,但这个绝对植的起点不是浏览器的左上角。而是图层A。


1.自动连接到另一页

<meta http-equiv="refresh" content="5;URL=index.htm">


2.虚线表格

<title>虚线</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.unnamed1 {  border: #000000; border-style: dotted; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<table width="289" border="0" cellpadding="0" cellspacing="0" class="unnamed1">
  <tr>
    <td width="289" height="220"></td>
  </tr>
</table>
</body>


3.不同分辨率返回不同页面

<script language="javascript">
<!-- Begin
if ((screen.width == 640) && (screen.height == 480)){
self.location.href=\'640*480.htm\'
}
else if ((screen.width == 800) && (screen.height == 600)){
self.location.href=\'800*600.htm\'
}
else if ((screen.width == 1024) && (screen.height == 768)){
self.location.href=\'1024*768.htm\'
}
else {self.location.href=\'else.htm\'
}
// End -->
</script>


4.显示曰期

<script language="javascript"><!--
today=new Date();
var week; var date;
if(today.getDay()==0) week="星期曰"
if(today.getDay()==1) week="星期一"
if(today.getDay()==2) week="星期二"
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()+"曰"+" "
document.write("<span style=\'font-size: 9pt;\'>"+date+week+"</span>");
// -->
</script>

5.表格一行多个
在table里加style="float:left"

6.css插入图片
css中插入背景图片,其写法好象应该是这样:
code { background-image: url("comet.jpg"); }
也就是需要加上url这三个字母(而非加上一个网址)

删掉后台的广告代码,再删incchar.asp里的flash广告条代码。


7.转入
<html>
<head>
<title>网管联盟!!!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="0;URL=http://xxx.x1212.com/">
</head>
<style>
body{font-size:9pt;line-height:15pt}
</style>
<body bgcolor="#FFFFFF" text="#000000" " leftmargin="0" topmargin="20" marginwidth="0" marginheight="0">
<center>正在转入网管联盟-http://xxx.x1212.com/,请稍候......</center>
</body>
</html>
本帖最近评分记录
  • 707609131 金币 +2 转用此贴,谢谢支持网建区 2007-11-30 20:10
[Quote][url]http://www.xvid.org/downloads.html[/url] 最下面xvidcore-1.1.0.tar.gz [url]http://www.skycn.com/soft/11695.html[/url] FFDShow[/Quote]

TOP

还是没我要的..............
[url=http://lovexx.qq.topzj.com/][size=8]欢迎光临 幻界动漫论坛[/size][/url]

TOP

好東西,支持一下哦!

TOP

发新话题