document.getElementById("id").style.xxx可以设置指定ID的控件的属性值。

主要支持以下一些属性设置:

盒子标签和属性对照
CSS语法(不区分大小写) JavaScript语法(区分大小写)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
float floatStyle
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
颜色和背景标签和属性对照
CSS 语法(不区分大小写) JavaScript 语法(区分大小写)
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
color color
 
样式标签和属性对照
CSS语法(不区分大小写) JavaScript 语法(区分大小写)
display display
list-style-type listStyleType
list-style-image listStyleImage
list-style-position listStylePosition
list-style listStyle
white-space whiteSpace
 
文字样式标签和属性对照
CSS 语法(不区分大小写) JavaScript 语法(区分大小写)
font font
font-family fontFamily
font-size fontSize
font-style fontStyle
font-variant fontVariant
font-weight fontWeight
 
文本标签和属性对照
CSS 语法(不区分大小写) JavaScript 语法(区分大小写)
letter-spacing letterSpacing
line-break lineBreak
line-height lineHeight
text-align textAlign
text-decoration textDecoration
text-indent textIndent
text-justify textJustify
text-transform textTransform
vertical-align

verticalAlign

使用如下:

document.getElementById("panel1").style.backgroundColor='#ff0000';

最新文章

  1. java 处理XML(dom4j-1.6.1)
  2. 搭建maven环境
  3. 安装包制作工具 SetupFactory使用1 详解
  4. Web Design - The Viewport
  5. iOS:导航栏的工具条和导航条
  6. ajax应用篇
  7. VC中利用多线程技术实现线程之间的通信
  8. 一些关于Console的API函数
  9. CentOS 使用yum命令安装Java SDK(openjdk)
  10. Python使用ctypes访问C代码
  11. hive上mysql元数据库配置
  12. Spring Boot中使用MyBatis注解配置详解(1)
  13. SQL慢查询测试实践
  14. JavaScript定时器详解
  15. 洛谷P1904
  16. 命令行听歌http://www.linuxsir.org/bbs/thread280142.html?pageon=1#1584689
  17. DotNetBar滚动条的疑似BUG
  18. 题解——HDU 1848 Fibonacci again and again
  19. 洛谷 5291 [十二省联考2019]希望(52分)——思路+树形DP
  20. 解决toad中number类型小数位数过长按科学计数法显示的问题

热门文章

  1. 实验12:Problem C: 重载字符的加减法
  2. Microsoft FIM: Working with Domino Connector v8
  3. FIL Dalian Jobs
  4. VC连接mysql数据库错误:libmysql.lib : fatal error LNK1113: invalid machine 解决方法
  5. Android常用设计模式(一)
  6. mybatis3.3 + struts2.3.24 + mysql5.1.22开发环境搭建及相关说明
  7. 在类库项目中使用log4net(RollingFileAppender)记录日志
  8. Swift语言实战晋级
  9. 关于nginx的限速模块
  10. nyoj 712 探 寻 宝 藏--最小费用最大流