You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

HTMLElement.style 속성은 요소의 인라인 스타일에 접근하거나 설정할 때 사용할 수 있습니다. 접근자로서는 요소의 인라인 style 속성이 포함한 CSS 선언을 담은 CSSStyleDeclaration 객체를 반환합니다


// Set multiple styles in a single statement
elt.style.cssText = "color: blue; border: 1px solid black"; 
// Or
elt.setAttribute("style", "color:red; border: 1px solid blue;");

// Set specific style while leaving other inline style values untouched
elt.style.color = "blue";


DOM Level 2 Style: ElementCSSInlineStyle.style

CSSOM: ElementCSSInlineStyle

브라우저 호환성

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
styleChrome Full support 45Edge Full support 12Firefox Full support Yes
Full support Yes
Notes Returns CSS2Properties, rather than CSSStyleDeclaration.
IE Full support YesOpera Full support YesSafari Full support 11WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?


Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

같이 보기