如何用css实现网页的动态效果

html-css010

如何用css实现网页的动态效果,第1张

网页的动态效果你说的这里的动态效果是让一个画面或者文字动一下吧?因为在专业里边动态是与数据库连接的后台的技术。

css是层叠样式表,是不能够实现动态效果的。但是可以让某个画面动,比如:

一个文字点击的时候,变大的css代码为:

a{font-size:12px}      /*这里文字默认大小是12像素*/

a:hover{font-size:14px}      /*这里鼠标经过大小是14像素*/

上边这个简单的代码就实现鼠标经过a的时候,文字变大,离开又恢复。

希望能帮到你

页面背景颜色渐变可以分为四个部分

一、从上往下渐变:

body{

FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#000000)

}

二、从左上至右下渐变:

body{

FILTER: Alpha( style=1,opacity=25,finishOpacity=100,

startX=50,finishX= 100,startY=50,finishY=100)

background-color: skyblue

}

三、从左往右渐变:

body{

FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#ffffff,endColorStr=#000000)

}

四、从上往下渐变:

style="filter:progid:DXImageTransform.microsoft.gradient(gradienttype=0,startColorStr=blue,endColorStr=white)"

下面是整合的完整格式:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html charset=gb2312" />

<title>背景渐变</title>

<style type="text/css">

<!--

body {

margin-left: 0px

margin-top: 0px

margin-right: 0px

margin-bottom: 0px

}

-->

</style></head>

<body>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="600" style="filter:progid:DXImageTransform.microsoft.gradient(gradienttype=0,startColorStr=blue,endColorStr=white)">&nbsp</td>

</tr>

</table>

</body>

</html>

如果是在同一个页面里面显示多重渐变效果,可以定义每个渐变的width和height。

代码:透明背景(带磨砂玻璃效果)  注:在粘贴到空白模板前一定先打个空格。

<STYLE type=text/css>

.bodytop{background:#transparent}

.banner{ background:#transparent}

.menu{ background:#transparent}

.bodyBg {background:#transparentfilter:progid:DXImageTransform.Microsoft.gradient(GradientType ='1',enabled='true',startColorstr=#AAFFFFFF, endColorstr=#AAFFFFFF)}

.zone{ background:#transparent}

.bodyBottom{background:#transparent}

.feeds .up{background:#transparent}

.feeds .down{background:#transparent }

.feeds .function{background:#transparent}

.feeds .page{background:#transparent}

.aList .sysHand .up{background:#transparent}

.aList .sysHand .down{background:#transparent}

.gbook .sysHand .up{background:#transparent}

.gbook .sysHand .down{background:#transparent}

.gbook .title{display:none}

.logo{display:none}

.gbook .page{background:#transparent }

.gbook .login{background:#transparent}

.box_1{background:#transparent}

.box_2{background:#transparent}

.calendar{background:#transparent}

.calendar .mid{background:#transparent}

.calendar .top{background:#transparent}

.calendar .title{background:#transparent}

.calendar .bold td{background:#transparent}

.calendar .bottom{background:#transparent}

.callboard .mid{background:#transparent}

.callboard .mid img{background:#transparent}

.callboard .front{background:#transparent}

.callboard .back{background:#transparent}

.callboard table{background:#transparent}

.callboard .up{background:#transparent}

.callboard .down{background:#transparent }

.sysBr{background:#transparent}

.sysBr210{background:#transparent}

.label{background:#transparent}

.label .mid{background:#transparent}

.label .top{background:#transparent}

.label .bottom{background:#transparent}

.photo{background:#transparent}

.photo .mid{background:#transparent}

.photo .image{background:#transparent}

.photo .top{background:#transparent}

.photo .bottom{background:#transparent}

.links{background:#transparent}

.links .up{background:#transparent}

.links .down{background:#transparent }

.links .mid{background:#transparent}

body{background:url("

http://s11.sinaimg.cn/orignal/439175a380fda7635072a

") repeat fixed!important}

.add{background:#transparent}

.add .ico{background:#transparent}

</STYLE>