文档介绍:-
. z.
网页按钮使用的各种代码
--- 按钮/p >
< /form >
---- 四、按钮字号和字型控制
---- 按钮上显示的文字也可以随意改变风格,可以设置字体的字型和字号,请看以下代码:
< form name="highlight" >
< p align="center" >
< input type="button" value="变化字号"
style="background-color: rgb(192,192,192);
-
. z.
FONT-FAMILY: 宋体; FONT-SIZE: 9pt"
color: rgb(255,2550,0)"); onclick >
< input type="button" value="变化字号"
style="background-color: rgb(192,192,192);
FONT-FAMILY: 宋体; FONT-SIZE: 12pt"
color: rgb(255,2550,0)"); onclick >
< /p >
< /form >
---- 五、按钮鼠标移动变色
---- 上面已经介绍了按钮的颜色控制方法,加上鼠标事件的参与即可实现鼠标移动变色,下面是完整的代码:
< html >
< head >
< meta -equiv="Content-Type"
content="te*t/html; charset=gb_2312-80" >
< meta name="GENERATOR" content=
"Microsoft FrontPage E*press " >
< title >变色按钮< /title >
< style >
.bigChange {color:blue; font-weight:bolder;
font-size:175%;letter-spacing:4p*;
te*t-transform: uppercase; background:yellow}
-
. z.
.start {color:ff0000; background:c8ff4e}
.over {color:ffff00; background:0000ff}
< /style >
< /head >
< body bgcolor="#83E09C" >
< p >
< script language="JAVASCRIPT" >
function highlightButton(s) {
if ("INPUT"==)
=s }
< /script > < /p >
< form name="highlight" onmouseover=
"highlightButton('start')"
onmouseout="highlightButton('over')" >
< p align="center" >< input type=
"button" value="变色按钮"); onclick > < /p >
< /form >
< /body >
< /html >
---- 六、鼠标移动按钮变字号
---- 利用同样的方法,也可以使按钮在鼠标移动时变换字号,其实字号的变化也引起了按钮尺寸的变化,这一效果能够引起游览者的注意力,当然也可以合起来使字号和颜色同时发生变化:
-
. z.
< html >
< head >
< meta -equiv="Content-Type"