DocumentOrShadowRoot.styleSheets

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

DocumentOrShadowRoot 인터페이스의 styleSheets 읽기 전용 속성(property)은 명시적으로 링크되거나 포함된 스타일 시트에 대한 CSSStyleSheet 객체의 StyleSheetList를 반환합니다.

Syntax

var styleSheetList = document.styleSheets;

Returns

반환되는 객체는 CSSStyleSheet 객체의 CSSStyleSheet 입니다.

Examples

function getStyleSheet(unique_title) {
  for(var i=0; i<document.styleSheets.length; i++) {
    var sheet = document.styleSheets[i];
    if(sheet.title == unique_title) {
      return sheet;
    }
  }
}

 

Notes

반환 된 목록은 다음과 같이 정렬됩니다:

  • Link 헤더에서 검색된 스타일시트가 먼저 배치되고, 헤더 순서로 정렬됩니다.
  • DOM에서 검색된 스타일시트는 tree order로 정렬되어 배치됩니다.

Specifications

Specification Status Comment
Shadow DOM
The definition of 'DocumentOrShadowRoot' in that specification.
Obsolete Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support YesIE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support 40Safari iOS Full support YesSamsung Internet Android Full support 6.0

Legend

Full support  
Full support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

문서 태그 및 공헌자

이 페이지의 공헌자: DeadIntegral
최종 변경자: DeadIntegral,