HTML 사전

span

설명

This HTML element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. <span> is very much like a <div> element, but <div> is a block-level element whereas a <span> is an inline element.

<span>요소는 generic inline container이며, 내용을 묶어주는 용도로 사용한다.요소들을 묶어서 같은 스타일을 적용해주려고 할 때 <span>요소를 사용할 수 있다. 이 때 <span>에 id class 값을 써준다. 또는 lang속성처럼 같은 속성을 공유할 때 <span>으로 묶어줄 수 있다.

의미상으로 적절한 다른 요소가 없을 때에만 <span>요소를 사용해야 한다. <span>요소는 <div>요소와 매우 유사하지만, <div>는 블럭 단위의 요소인 반면에, <span>요소는 인라인 요소이다.

Usage Context

Permitted content Phrasing content
Tag omission None, must have both a start tag and an end tag.
Permitted parent elements Any element that accepts phrasing content, or any element that accepts flow content.
Normative document HTML5, section 4.6.24; HTML 4.01, section 7.5.4

속성

이 엘리먼트는 전역속성을 지원한다.

예제

<p><span>Some text</span></p>
<p><span>깔때기다!</span></p>

DOM Interface

This element implements the HTMLSpanElement interface.

이 요소는 HTMLSpanElement 인터페이스를 구현했다.

호환성

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

참고

댓글

댓글 본문
버전 관리
김나솔
현재 버전
선택 버전
graphittie 자세히 보기