【Asp.Net】document.getElementById 的属性介绍
2024-10-19 02:23:30
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';
最新文章
- java 处理XML(dom4j-1.6.1)
- 搭建maven环境
- 安装包制作工具 SetupFactory使用1 详解
- Web Design - The Viewport
- iOS:导航栏的工具条和导航条
- ajax应用篇
- VC中利用多线程技术实现线程之间的通信
- 一些关于Console的API函数
- CentOS 使用yum命令安装Java SDK(openjdk)
- Python使用ctypes访问C代码
- hive上mysql元数据库配置
- Spring Boot中使用MyBatis注解配置详解(1)
- SQL慢查询测试实践
- JavaScript定时器详解
- 洛谷P1904
- 命令行听歌http://www.linuxsir.org/bbs/thread280142.html?pageon=1#1584689
- DotNetBar滚动条的疑似BUG
- 题解——HDU 1848 Fibonacci again and again
- 洛谷 5291 [十二省联考2019]希望(52分)——思路+树形DP
- 解决toad中number类型小数位数过长按科学计数法显示的问题
热门文章
- 实验12:Problem C: 重载字符的加减法
- Microsoft FIM: Working with Domino Connector v8
- FIL Dalian Jobs
- VC连接mysql数据库错误:libmysql.lib : fatal error LNK1113: invalid machine 解决方法
- Android常用设计模式(一)
- mybatis3.3 + struts2.3.24 + mysql5.1.22开发环境搭建及相关说明
- 在类库项目中使用log4net(RollingFileAppender)记录日志
- Swift语言实战晋级
- 关于nginx的限速模块
- nyoj 712 探 寻 宝 藏--最小费用最大流