This article mainly shares with you the method of obtaining non-interline style with variable parameter css function. I hope it can help you.
1. Variable parameters
2. CSS function
3. Obtain non-interline style
When using window.onload(), it cannot be nested inside Other functions, but can call other functions.
There are two ways to obtain non-interline styles.
The first is: the usage method of currentStyle is the same as style, but it is only compatible with IE.
The second is: getComputedStyle, the usage method is getComputedStyle(op, false).width; where the first parameter is the name of the object to be obtained , the second parameter is an arbitrary value.
When getting interline styles, you cannot use getComputedStyle to get compound styles, such as background, but if you want to get the background color, you can use backgroundcolor
Related recommendations:
How to get non-interline style? Using js and jquery to obtain non-interline styles
JS to obtain non-interline styles and compatibility issues_html/css_WEB-ITnose
About css non-interline How to use style, solve ~_html/css_WEB-ITnose
The above is the detailed content of How to obtain non-interline style using variable parameter css function. For more information, please follow other related articles on the PHP Chinese website!