Home > Web Front-end > H5 Tutorial > body text

HTML5中对style属性的解释与规定

WBOY
Release: 2016-05-17 09:09:59
Original
3575 people have browsed it

所有HTML元素都可以设置style属性,用以设置CSS样式,其值需符合CSS样式书写标准。
为元素设置的style属性值,将覆盖相同的、以其他形式为其设置的css属性,例如外部文件。
应保证,当元素的style的属性值去掉之后,元素仍然可理解、可用。
element.style
将返回一个CSSStyleDeclaration对象,可以用来设置或返回元素的style属性值。
例如

document.getElementById('id_value').style.display = "none";


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!