알아야 할 13가지 HTML 속성

Accept 속성

1
<input type="file" accept=".jpg, .jpeg, .png" />

Alt 속성

1
<img src="nature.png" alt="A beautiful sunset" />

Autocomplete 속성

1
<input type="text" name="name" autocomplete="on" />

Contenteditable 속성

1
<div contenteditable="true">You can edit this content.</div>

Download 속성

1
<a href="document.pdf" download="document.pdf">Download PDF</a>

Hidden 속성

1
<div hidden>This is hidden content.</div>

Loading 속성

1
<img src="image.png" loading="lazy" />

Multiple 속성

1
2
3
4
5
6
7
<input type="file" multiple />
<select multiple>
<option value="java">Java</option>
<option value="javascript">JavaScript</option>
<option value="typescript">TypeScript</option>
<option value="rust">Rust</option>
</select>

Poster 속성

1
2
3
<video controls poster="image.png" width="500">
<source src="video.mp4" type="video/mp4" />
</video>

Readonly 속성

1
<input type="text" value="This is readonly." readonly />

Srcset 속성

1
<img src="image.jpg" srcset="image.jpg, image-2x.jpg, image-3x.jpg" />

Spellcheck 속성

1
<input type="text" spellcheck="false" />

Title 속성

1
<a href="document.pdf" title="Click to download">Download File</a>
Share