html设置背景色和字体颜色--兼容各浏览器

 1 <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
 2 < html  xmlns ="http://www.w3.org/1999/xhtml" >
 3 < head >
 4 < META  content ="text/html; charset=utf-8"  http-equiv =Content-Type >
 5 < title > 缔友计算机信息技术有限公司--html设置背景色和字体颜色--兼容各浏览器Setting the bgColor & fgColor Properties </ title >
 6 < meta  name ="description"  content ="涂聚文,捷为工作室,经营信息流,物流,人力资源流,资本流的系统解决方案的开发与设计和服务,geoVI studio.Geovin Du. Systems Solution to Fund flow,and Information flow,and Material flow,and Control flow,and Human Resource.Applied software development,design and service。." >
 7 < meta  name ="Robots"  content ="all index follow " >
 8 < meta  name ="Author"  content ="涂聚文"   />
 9 < link  rel ="shortcut icon"  href ="http://www.dupcit.com/favicon.ico"  type ="image/x-icon"   />
10 < link  rel ="icon"  href ="http://www.dupcit.com/favicon.ico"  type ="image/ico"   />
11 < link  rel ="Bookmark"  href ="http://www.dupcit.com/favicon.ico" >
12 </ head >
13 < body >
14 < DIV >< p >
15 字体颜色
16 < form >
17
18 < input  type ="button"
19  value ="White"
20  onClick ="document.bgColor = '#FFFFFF';document.fgColor='#FF0000';" >
21  
22 < input  type ="button"
23  value ="Green"
24  onClick ="document.bgColor = '#008000';document.fgColor='#FFFF00';" >
25  
26 < input  type ="button"
27  value ="Blue"
28  onClick ="document.bgColor = '#0000FF';document.fgColor='#FFFFFF';" >
29  
30 < input  type ="button"
31  value ="Red"
32  onClick ="document.bgColor = '#FF0000';document.fgColor='#FFFF00';" >
33
34 </ form ></ p >
35 </ DIV >
36 < FORM >
37
38       < H3 > BackGround Colors </ H3 >
39       < INPUT  TYPE ="button"  VALUE =" Red "  onClick ="document.bgColor = 'red'" >
40       < INPUT  TYPE ="button"  VALUE =" White "  onClick ="document.bgColor = 'white'" >
41
42       < H3 > ForeGround Colors </ H3 >
43       < INPUT  TYPE ="button"  VALUE =" Blue "  onClick ="document.fgColor = 'blue'" >
44       < INPUT  TYPE ="button"  VALUE =" Green "  onClick ="document.fgColor = 'green'" >
45
46 </ FORM >
47
48 </ body >
49 </ html >
50
51

更多专业前端知识,请上 【猿2048】www.mk2048.com
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值