HTML 사전

code

설명

The HTML Code Element (<code>) represents a fragment of computer code. By default, it is displayed in the browser's default monospace font.

A CSS rule can be defined for the code selector to override the browser's default font face. Preferences set by the user might take precedence over the specified CSS.

<code>는 컴퓨터 개발 언어 코드를 구분해서 표시할 때 사용한다. <code>로 묶여진 텍스트를 고정폭폰트(monospace)로 표시한다. 

브라우저의 기본 고정폭폰트말고 다른 모양으로 표시하려면, code selector용으로 정의된 CSS rule을 사용하면 된다.웹브라우저 사용자가 지정한 폰트설정이 CSS에 우선하여 적용될 수 있다. 

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.
Normative document HTML5, section 4.6.10; HTML 4.01, section 9.2.1

속성

Like all other HTML elements, this element supports the global attributes.

다른 HTML요소와 마찬가지로, 이 요소는 전역속성을 지원한다.

지원 Gecko Presto WebKit Trident
       
Normative document  

예제

 <p>Regular text. <code>This is code.</code> Regular text.</p>  
 <p>일반 텍스트 <code>이 부분은 코드입니다.</code> 또 다시 일반 텍스트이고요.</p>

DOM Interface

This element implements the HTMLElement interface.

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

호환성

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

참고

댓글

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