首页 > php教程 > PHP开发 > 正文

CSS属性与JavaScript 编码方法对照表

高洛峰
发布: 2016-11-28 16:20:56
原创
1210人浏览过

css与js紧密配合,为我们的页面增添了很多别致的效果。为了达到某种特殊的效果我们需要用javascript动态的去更改某一个标签的css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:javascript中style后面的属性应该是什么?

 CSS属性与JavaScript 编码方法对照表

JavaScript CSS Style属性对照表

盒子标签和属性对照

立即学习Java免费学习笔记(深入)”;

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

豆包AI编程
豆包AI编程

智能代码生成与优化,高效提升开发速度与质量!

下载
相关标签:
css
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号