Commonly used attributes
HTML attributes are additional properties that can be added to HTML elements to provide extra information or modify the behavior of the elements. id:
<div id="myElement">This is a div with an ID</div>
class:
<p class="highlighted">This paragraph has a class</p>
style:
<span style="color: red; font-size: 16px;">Red and larger text</span>
src:
<img src="image.jpg" alt="An image">
href:
<a href="https://www.example.com">Visit Example</a>
href:
<img src="image.jpg" alt="A beautiful landscape">
alt:
<img src="image.jpg" alt="A beautiful landscape">
disabled:
<button type="button" disabled>Disabled Button</button>
required:
<input type="text" required>
by Luka Tatarishvili
1 year ago
HTML
Attributes
0
Pro tip: use ```triple backticks around text``` to write in code fences