HTML 사전

style

설명

Style element contains style information for a document. Style information should go inside of this element, usually in the CSS language (see CSS).

style 요소는 문서 내의 스타일 정보를 담고 있다. 스타일 정보는 반드시 이 요소 내에 있어야 하며, 보통 CSS언어로 작성된다. (CSS 참고)

Usage Context

Permitted content Depends on value of type attribute.
Tag omission None, must have both a start tag and an end tag.
Permitted parent elements None, must have both a start tag and an end tag.
Normative document HTML5, section 4.2.6; HTML 4.01, section 14.2.3

속성

이 요소는 전역속성을 지원한다.

type

This attribute defines the styling language as a MIME type should not be specified). 'text/css' is assumed if this attribute is absent.

본 속성은 MIME 형식으로 스타일 언어를 정의한다. (charset은 사용할 수 없다.)  만약 본 속성을 정의하지 않으면, 'text/css' 를 기본값으로 간주한다.

media

Which media should this style apply to. Should be a media query, see http://dev.w3.org/csswg/css3-mediaqueries.

어떤 유형의 미디어 형식에 본 스타일을 적용할지를 정의한다. 반드시 media query이어야 한다. (참고 : http://dev.w3.org/csswg/css3-mediaqueries / http://html.nhndesign.com/blog/textyle/42284)

scoped

If this attribute is present, then style applies only to it's parent element. If absent, style applies to the whole document.

이 속성이 정의된 스타일 요소는 부모 요소에게만 적용되며, 이 속성이 정의되지 않으면 스타일이 전체 문서에 적용된다.

title

Specifies alternative style sheet sets.

표준 속성(standard attribute)으로서, 스타일시트 세트의 부가적인 정보를 정의한다.

예제

<style type="text/css">
body {
  color:red;
}
</style>

DOM Interface

이 요소는 HTMLStyleElement 인터페이스를 구현한다.

호환성

Desktop
기능 구글크롬 파이어폭스Gecko) 인터넷 익스플로러 Opera Safari
기본적인 지원          
Mobile
기능 안드로이드 파이어폭스 모바일(Gecko) 인터넷 익스플로러 모바일 오페라 모바일 사파리 모바일
기본적인 지원          

참고

댓글

댓글 본문
  1. engfordev
    표시 잘 해주셨습니다 ^^
    대화보기
    • Albert.q.park
      노랑색은 해석하면서 확신을 갖지 않고 붙여넣은 것들이니. 저게 정말이라고 누가 확인해주세요~
    버전 관리
    epic
    현재 버전
    선택 버전
    graphittie 자세히 보기