HTML Iframe

iframe은 웹 페이지 내에서 웹 페이지를 표시하는 데 사용됩니다.

iframe 추가 문법

<iframe src="URL</iframe>

URL 독립된 페이지의 위치를 지정합니다.

Iframe - 높이와 너비 설정

height 및 width 속성은 iframe의 높이와 너비를 정의합니다.

속성 값의 기본 단위는 픽셀입니다만, 백분율로 설정할 수도 있습니다(예: "80%").

예제

<iframe src="demo_iframe.htm" width="200" height="200"></iframe>

직접 시험해 보세요

Iframe - 테두리 제거

frameborder 속성은 iframe 주위의 테두리를 표시할지 여부를 정의합니다.

속성 값을 "0"으로 설정하면 테두리를 제거할 수 있습니다:

예제

<iframe src="demo_iframe.htm" frameborder="0"></iframe>

직접 시험해 보세요

iframe을 링크의 목표로 사용

iframe은 링크의 목표(target)으로 사용될 수 있습니다.

링크의 target 속성은 iframe의 name 속성을 참조해야 합니다:

예제

<iframe src="demo_iframe.htm" name="iframe_a"</iframe>
<p><a href="http://www.codew3c.com" target="iframe_a">codew3c.com</a></p>

직접 시험해 보세요

HTML iframe 태그

태그 설명
<iframe> 인라인의 자식 창(프레임)을 정의