>  기사  >  웹 프론트엔드  >  HTML에 태그 삽입

HTML에 태그 삽입

WBOY
WBOY원래의
2024-09-04 16:32:27708검색

HTML의 Embed 태그는 외부 리소스나 애플리케이션을 표시하기 위한 것입니다. 이는 HTML 애플리케이션에 비디오 파일이나 오디오 파일을 표시하는 것과 같은 멀티미디어 콘텐츠에 주로 사용됩니다. 이 태그는 플래시 애니메이터와 같은 플러그인을 가져오는 데에도 사용됩니다. 이 태그는 HTML 5 버전에서 도입되었습니다.

, , , 와 같은 종료 태그가 있습니다. 등등

실시간 예: 우리는 수많은 웹사이트에 해당 웹사이트 내에 미디어 파일이 포함되어 있는 것을 보았습니다. 미디어 파일을 표시하는 데 일반 태그가 지원되지 않습니다. 그래서 우리는 HTML의 모든 유형의 미디어 파일에 embed 태그를 사용했습니다.

참고: 이 태그는 이미지와 외부 HTML 파일을 포함하는 데에도 사용됩니다.

Html에서 Embed 태그는 어떻게 작동하나요?

HTML 삽입 작업은 4가지 속성을 기반으로 합니다. 이러한 속성은 삽입이 수행해야 하는 작업을 지정합니다.

구문:

<embed Required attributes>

필수 속성: 태그는 모든 HTML 문서의 속성을 허용합니다.

1. height: 삽입된 콘텐츠 요소의 높이를 지정하는 데 사용되는 속성입니다. 이 값은 픽셀 단위입니다.

구문:

<embed height="value in pixels">

2. width: 삽입된 콘텐츠 요소의 너비를 지정하는 데 사용되는 속성입니다. 이 값은 픽셀 단위입니다.

구문:

<embed width="value in pixels">

3. src: 웹 URL을 전달하는 데 사용됩니다. 이는 삽입된 콘텐츠의 웹 주소를 지정하는 데 사용된다는 의미입니다.

구문:

<embed src="web URL">

4. 유형: 이 속성은 비디오 또는 오디오와 같은 미디어 유형을 지정하는 데 사용됩니다.

구문:

<embed type="type of media">

HTML에 태그 삽입 예시

아래에 언급된 예는 다음과 같습니다.

예 #1 – 이미지 삽입

코드:

<!DOCTYPE html>
<html>
<title>embed attribute</title>
<head>
<!-- CSS Code -->
<style>
p {
color: red;
border: 2px solid green;
font-size: 22px;
}
h1 {
color: orange;
text-align: center;
}
</style>
</head>
<body>
<h1>The embed tag introduction</h1>
<p>
The
<embed>
tag in HTML purpose is for displaying external resources or
applications. This is used mostly in multimedia content like showing
video files or audio files into out HTML application. This embed tag
is also used for importing plug-ins like flash animators. This embed
tag is introduced in HTML 5 version. It does have ending tag as like p
tag, <html>, <body>, <a> etc.
</p>
<p>Real Time Example: We have seen so many website contains media
files within that websites. Normal tag are not supported to display
media files. So we have used embed tag for all types of media files in
HTML.</p>
<h1>The embed tag Example</h1>
<embed src="d6.jpg" width="400" height="400">
</body>
</html>

출력:

HTML에 태그 삽입

예 #2 – 다른 HTML 리소스와 함께 삽입

HTML 코드: EmbedResource.html

<!DOCTYPE html>
<html>
<title>embed attribute</title>
<body>
<!-- Embed content from other html file -->
<embed src="Resource.html" width="1000" height="200">
</body>
</html>

HTML 코드: Resource.html

<!DOCTYPE html>
<html>
<title>embed attribute</title>
<head>
<!-- CSS Code -->
<style>
p {
color: brown;
border: 2px ridge navy;
font-size: 22px;
}
h1 {
color: blue;
text-align: center;
}
</style>
</head>
<body>
<h1>The embed tag introduction</h1>
<p>
The
<embed>
tag in HTML purpose is for displaying external resources or
applications. This is used mostly in multimedia content like showing
video files or audio files into out HTML application. This embed tag
is also used for importing plug-ins like flash animators. This embed
tag is introduced in HTML 5 version. It does have ending tag as like p
tag, <html>, <body>, <a> etc.
</p>
<p>Real Time Example: We have seen so many website contains media
files within that websites. Normal tag are not supported to display
media files. So we have used embed tag for all types of media files in
HTML.</p>
</body>
</html>

출력:

HTML에 태그 삽입

HTML에 태그 삽입

예시 #3 – 동영상 파일 삽입

코드:

<!DOCTYPE html>
<html>
<title>embed attribute</title>
<head>
<!-- CSS Code -->
<style>
p {
color: brown;
border: 2px ridge navy;
font-size: 22px;
}
h1 {
color: blue;
text-align: center;
}
</style>
</head>
<body>
<h1>The embed tag introduction</h1>
<p>
The
<embed>
tag in HTML purpose is for displaying external resources or
applications. This is used mostly in multimedia content like showing
video files or audio files into out HTML application. This embed tag
is also used for importing plug-ins like flash animators. This embed
tag is introduced in HTML 5 version. It does have ending tag as like p
tag, <html>, <body>, <a> etc.
</p>
<p>Real Time Example: We have seen so many website contains media
files within that websites. Normal tag are not supported to display
media files. So we have used embed tag for all types of media files in
HTML.</p>
<!-- Embed content from other video file -->
<embed src="nationalgeography.mp4" width="400" height="300">
</body>
</html>

출력:

HTML에 태그 삽입

HTML에 태그 삽입

결론

HTML에 포함은 HTML 애플리케이션에 비디오 및 오디오 파일을 포함하는 데 사용됩니다. 이 외부 포함 리소스는 높이 및 너비 속성을 사용하여 요구 사항에 따라 크기를 조정할 수 있습니다.

위 내용은 HTML에 태그 삽입의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:HTML의 tfoot다음 기사:HTML의 tfoot