• 회원가입
  • 로그인
  • 구글아이디로 로그인

[attribute] HTML - src 속성 ★ - 외부 리소스 URL주소 지정 (= src속성 = 에스알시속성/에스알씨속성/소스속성)

목차
  1. src 예제 - <audio> 경우
  2. src 정의
  3. src 구문
  4. src 예제 - <embed> 경우
  5. src 예제 - <iframe> 경우
  6. src 예제 - <img> 경우
  7. src 예제 - <input> 경우
  8. src 예제 - <script> 경우
  9. src 예제 - <source> 경우
  10. src 예제 - <track> 경우
  11. src 예제 - <video> 경우

 

src 예제 - <audio> 경우

 

<audio src="https://ccrma.stanford.edu/~jos/mp3/harpsi-cs.mp3" controls>

당신 브라우저는 audio 태그 지원 X

</audio>

 

결과보기

 

src 정의

 

외부 리소스 URL주소 지정.

 


 

1. src 속성 사용 가능 태그 종류

<audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video>

 

2.

<audio> 경우, ogg 파일은 Firefox, Opera, Chrome, Edge에서 작동. (IE나 Safari에서 오디오 파일을 재생하려면 MP3 파일을 사용해야 함.)

 

 

3.

주요 최신 브라우저 모두 지원.

 

 

src 구문

 

  • <audio src="URL">...</audio>
  • <embed src="URL">
  • <iframe src="URL">...</iframe>
  • <img src="URL">
  • <input type="image" src="URL">
  • <script src="URL"></script>
  • <source src="URL">
  • <track src="URL">
  • <video src="URL">...</video>

 


[속성값]

 

URL

리소스 파일 주소 (※ 절대주소/상대주소 모두 가능)

 

 

src 예제 - <embed> 경우

 

<embed src="https://i.imgur.com/WfW5mBC.png">

 

결과보기

 

src 예제 - <iframe> 경우

 

<iframe src="https://homzzang.com">

  <p>당신 브라우저는 iframe 지원 X</p>

</iframe>

 

 

src 예제 - <img> 경우

 

<img src="https://i.imgur.com/WfW5mBC.png" alt="홈짱닷컴" width="185" height="39">

 

결과보기

 

src 예제 - <input> 경우

 

<form action="/action_page.php">

  <label for="name">이름:</label>

  <input type="text" id="name" name="name"><br><br>

  <input type="image" src="submit.gif" alt="확인" width="30" height="30">

</form>

 

 

src 예제 - <script> 경우

 

<script src="myScript.js"></script>

 

 

src 예제 - <source> 경우

 

<audio controls>

  <source src="music.ogg" type="audio/ogg">

  <source src="music.mp3" type="audio/mpeg">

  당신 브라우저는 audio 태그 지원 X

</audio>

 

 

src 예제 - <track> 경우

 

<video width="560" height="315" controls>

  <source src="movie.mp4" type="video/mp4">

  <source src="movie.ogg" type="video/ogg">

  <track src="movie_en.vtt" kind="subtitles" srclang="en" label="영어">

  <track src="movie_ja.vtt" kind="subtitles" srclang="ja" label="일본어">

</video>

 

 

src 예제 - <video> 경우

 

<video width="250" height="500" controls src="https://thumbs.gfycat.com/FoolhardyMiserlyAsiantrumpetfish-mobile.mp4">

  당신 브라우저는 video 태그 지원 X

</video>

 

결과보기

 


분류 제목
attribute HTML - srcdoc 속성 - 아이프레임(iframe) src 속성 내용 대체할 태그내용 지정 (= sr…
attribute HTML - srclang 속성 - 트랙태그 소스의 언어코드 지정 (= srclang속성 = 에스알시랭속성/…
attribute HTML - srcset 속성 - 다른 환경에서 적용할 이미지소스 지정 (= srcset속성 = 에스알시셋속…
attribute HTML - start 속성 - 순서있는 리스트 시작값 설정 (= start속성 = 스타트속성) ※ 오엘태그…
attribute HTML - step 속성 - 입력 가능 숫자 간격 설정 (= step속성 = 스텝속성) ※ 입력 가능 배수…
attribute HTML - style 속성 ★ - 인라인 스타일 지정 (= style속성 = 스타일속성)
attribute HTML - tabindex 속성 - 탭색인번호 지정 (= tabindex속성 = 탭인덱스속성) ※ 탭넵비게…
attribute HTML - target 속성 ★ - (링크된 문서 열 곳 / 폼 제출할 곳) 지정 (= target속성 =…
attribute HTML - title 속성 ★ - 요소애 대한 추가 정보 지정 (= title속성 = 타이틀속성)
attribute HTML - translate 속성 - 요소 내용 번역 허용 여부 지정 (= translate속성 = 트랜슬…
attribute HTML - type 속성 ★★★ - 요소 타입 지정 (= type속성 = 타입속성)
attribute HTML - usemap 속성 - 이미지를 이미지맵으로 지정 (= usemap속성 = 유즈맵속성|유스맵속성)
attribute HTML - value 속성 ★★★ - 요소값 지정 (= value속성 = 밸류속성) ※ 초기값/기본값/현재…
attribute HTML - width 속성 - 너비 지정 (= width속성 = 위드스속성) ※ 가로길이 설정
attribute HTML - wrap 속성 - FORM 제출 시, TEXTAREA 텍스트 감싸기 (= wrap속성 = 랩속성…
etc HTML - 일정시간 후 페이지 이동/납치
deprecated HTML - <marquee> 태그 - 요소 내용 자동 스크롤 이동 영역 지정 (= marquee태그 = 마…
attribute HTML - rev 속성 - (HTML5 지원 X) 현재 웹문서가 타웹문서와 어떤 관계인지 지정 (= re…
image HTML - <picture> 태그 - 해상도 크기에 따라 다른 이미지 표시 지정 (= picture태그 =…
attribute HTML - formtarget 속성 - 폼데이터 전달할 폼 지정 (= formtarget속성 = 폼타겟속성…
16/18
목록
찾아주셔서 감사합니다. Since 2012