element.style

번역이 완료되지 않았습니다. Please help translate this article from English

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
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
styleChrome Full support 45Edge Full support 12Firefox Full support 1IE Full support 8Opera Full support 8Safari Full support 11WebView Android Full support 45Chrome Android Full support 45Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 11Samsung Internet Android Full support 5.0

Legend

Full support  
Full support

같이 보기