An HTML element's class names can be specified using the class attribute. JavaScript and CSS can both utilize classes to do particular actions on subsets of components and to style elements selectively.
Key Points:
Example:
<div class="header highlight">
<p class="highlight">This text can be styled distinctly.</p>
</div>
.highlight {
background-color: yellow;
}
.header {
font-size: 24px;
}
An HTML element's class names can be specified using the class attribute. JavaScript and CSS can both utilize classes to do particular actions on subsets of components and to style elements selectively.
Key Points:
Example:
<div class="header highlight"> <p class="highlight">This text can be styled distinctly.</p> </div>
.highlight { background-color: yellow; } .header { font-size: 24px; }
Use the <link> tag inside the <head> to attach an external CSS file.
Comments in HTML are written between <!-- and -->.
HTML entities are used to display reserved or special characters.
The <iframe> tag embeds another webpage within the current page.
The id attribute uniquely identifies a single HTML element.
Hyperlinks are created using the <a> tag with an href attribute.
Use the <img> tag and specify the image source with the src attribute.
Use the target="_blank" attribute inside the <a> tag.
Copyrights © 2024 letsupdateskills All rights reserved