注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
没有相关文章
您现在的位置: 顶尖设计 >> IT学院 >> 图形 >> 网页 >> dreamweaver >> 文章正文
Dhtml实例教程(一)
作者:佚名  来源:转载  点击:  更新:2006-11-17
简介:

 

例4 使用onclick动态改变字体的颜色
<html>
<head>
<title>DHtml举例4</title>
</head>
<body>
<h3 align="center" onmouseover="this.style.color='red'" onmouseout="this.style.color='green'" onclick="this.style.color='blue'">我是变色龙!</h3>
</body>
</html>

在这一例子中,当您把鼠标移动到文字上时,文字颜色变为红色,当鼠标离开文字时,文字颜色变为绿色,当在文字上单击鼠标时,文字颜色变成了蓝色。
下面是我用样式单制作的一个自认为比较漂亮的Html文件。

例5 “轻松自学动态HTML”的图形标志
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>DHtml举例5
<style>
<!--
body {font-family:"宋体";font-size:9pt;color:#00aaff}
h2.top {font-family:serif;font-size:9pt;color:yellow;text-align:right;background-color:rgb(174,0,0)}
h2.bottom {font-family:serif;font-size:12pt;margin-left:-2pt;margin-top:-50pt}
-- >
</style>
</head>
<body bgcolor="#000000">
<br>
<table align="center" border="0" width="27%" bgcolor="#000000" cellpadding="12">
<tr>
<td width="168"><h2 class="top">轻 松 自 学  动  态  HTML</h2>
<h2 class="bottom"><span style="font-size:50pt;color:lime"><i>t</i></span>
  each   youself  DHtml</h2>
</td>
</tr>
</table>
</body>
</html>

请注意例子中的蓝色部分,class属性是用来定义标志对使用的样式类,如<h2 class="top">……</h2>指定了 <h2></h2>标志对中使用样式类“top”,而“top”则是在<style>< style>标志对中定义的。
OK,您会了吗?样式单就这么简单。

上一页  [1] [2] [3] [4] [5] [6] [7] [8] 下一页






  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务