<img class="fit-picture"
src="/media/cc0-images/grapefruit-slice-332-332.jpg"
alt="Grapefruit slice atop a pile of other slices"
width="300" height="400">
JPEG, PNG, GIF, WEBP 는 레스터 이미지
SVG는 벡터 이미지
✔ 지원하는 웹브라우저를 알고 싶다면? ➡ https://caniuse.com/
✔ 여백 크기 미리보기 이미지 ➡ https://placeholder.com/
srcset
sizes
<img class="fit-picture"
src="/media/cc0-images/grapefruit-slice-332-332.jpg"
srcset="image경로 300w, image경로 450w, image경로 600w"
sizes="(min-width: 600px) 600px, (min-width: 450px) 450px, 300px"
alt="Grapefruit slice atop a pile of other slices">
<video controls width="250">
<source src="/media/cc0-videos/flower.webm"
type="video/webm">
<source src="/media/cc0-videos/flower.mp4"
type="video/mp4">
Sorry, your browser doesn't support embedded videos.
</video>
<figure>
<figcaption>Listen to the T-Rex:</figcaption>
<audio
controls
src="/media/cc0-audio/t-rex-roar.mp3">
Your browser does not support the
<code>audio</code> element.
</audio>
</figure>
canvas
iframe
<iframe id="inlineFrameExample"
title="Inline Frame Example"
width="300"
height="200"
src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik">
</iframe>
action
method
post
: POST 메서드. 양식 데이터를 요청 본문으로 전송get
: GET 메서드. 양식 데이터를 action
URL과 ?
구분자 뒤에 이어 붙여서 전송<dialog>
안에 위치한 경우, 제출과 함께 대화 상자를 닫음label
input
<label for="name">Name (4 to 8 characters):</label>
<input type="text" id="name" name="name" required
minlength="4" maxlength="8" size="10">
<label>food: <input type="text" name="food"></label>
fieldset
legend
<fieldset>
콘텐츠의 설명<form>
<fieldset>
<legend>Choose your favorite monster</legend>
<input type="radio" id="kraken" name="monster">
<label for="kraken">Kraken</label><br/>
<input type="radio" id="sasquatch" name="monster">
<label for="sasquatch">Sasquatch</label><br/>
<input type="radio" id="mothman" name="monster">
<label for="mothman">Mothman</label>
</fieldset>
</form>
속성값 참고 ➡ MDN-input
type 속성값
함께 사용가능한 속성들 : name, placeholder, autocomplete, required, disabled, readonly
<button class="favorite styled"
type="button">
Add to favorites
</button>
button vs input
<button>
요소는 스타일을 적용하기 훨씬 수월함
<input>
은 value 특성에 텍스트 값밖에 지정할 수 없지만,<button>
은 내부 HTML 콘텐츠(<img>
도 가능)에 더해 ::after와 ::before 의사 요소를 사용하는 복잡한 렌더링도 가능
select
option
optgroup
<label for="dino-select">Choose a dinosaur:</label>
<select id="dino-select">
<optgroup label="Theropods">
<option>Tyrannosaurus</option>
<option>Velociraptor</option>
<option>Deinonychus</option>
</optgroup>
<optgroup label="Sauropods">
<option>Diplodocus</option>
<option>Saltasaurus</option>
<option>Apatosaurus</option>
</optgroup>
</select>
datalist
<label for="ice-cream-choice">Choose a flavor:</label>
<input list="ice-cream-flavors" id="ice-cream-choice" name="ice-cream-choice" />
<datalist id="ice-cream-flavors">
<option value="Chocolate">
<option value="Coconut">
<option value="Mint">
<option value="Strawberry">
<option value="Vanilla">
</datalist>
<label for="story">Tell us your story:</label>
<textarea id="story" name="story"
rows="5" cols="33">
It was a dark and stormy night...
</textarea>