Javascript controls CSS style attributes syntax comparison table _ basic knowledge

Source: Internet
Author: User
Tags comparison table
CSS and JS work closely together to add a lot of unique effects to our pages, to achieve some special effect, we need to use Javascript to dynamically change the CSS attribute of a tag. CSS works closely with JS, adding a lot of unique effects to our page. To achieve some special effect, we need to use Javascript to dynamically change the CSS attribute of a tag.

For example, it is often used to close a floating ad display: document. getElementById ('ad'). style. display = 'none'; equivalent to:. ad {display: none }.

The following is the syntax comparison of CSS style sheets controlled by JS.:
CSS syntax (Case Insensitive) JavaScript syntax (Case Sensitive)
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
Background Background
Background-attachment BackgroundAttachment
Background-color BackgroundColor
Background-image BackgroundImage
Background-position BackgroundPosition
Background-repeat BackgroundRepeat
Color Color
Display Display
List-style-type ListStyleType
List-style-image ListStyleImage
List-style-position ListStylePosition
List-style ListStyle
White-space WhiteSpace
Font Font
Font-family FontFamily
Font-size FontSize
Font-style FontStyle
Font-variant FontVariant
Font-weight FontWeight
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.