HTML Elements Get Certified
What are HTML Elements?
HTML elements are the fundamental building blocks of every web page. Each element is defined by a start tag, content, and an end tag (except for void/self-closing elements). Understanding HTML elements is essential for creating structured, accessible, and semantic web content.
Examples and Practical Demonstrations
1. Basic HTML Element Structure
Every HTML element follows a simple pattern of opening tag, content, and closing tag.
What this code does: Shows the classic structure of an HTML element with opening tag, content, and closing tag.
<p>This is a paragraph element.</p>
2. Radio Buttons
Radio buttons in HTML allow users to select one option from a predefined set, using the <input type="radio"> element.
What this code does: Creates a form with two radio options that share the same name, so only one can be selected at a time.
<!-- Radio Buttons -->
<form>
<input type="radio" id="opt1" name="group" value="1">
<label for="opt1">Option 1</label>
<input type="radio" id="opt2" name="group" value="2">
<label for="opt2">Option 2</label>
</form>
3. Anchor & Mailto Link
The <a> (anchor) tag in HTML is used to create hyperlinks that connect to other webpages, files, or locations within the same page. While, HTML mailto link uses the <a> tag with a mailto: attribute to open the user’s default email client and start composing a new message.
What this code does: Shows an internal page jump via href="#id" and a mailto: link that opens the user’s email client.
<!-- Anchor and Mailto -->
<a href="#target-section" class="html anchor">Go to Target Section</a>
<br><br>
<a href="mailto:info@example.com" class="mailto html link">Email Us</a>
<br><br><br><br><br><br>
<section id="target-section">
<h2 class="section-heading">Target Section</h2>
<p>You have landed on the target section using an anchor link! This is how internal navigation works using the <code>id</code> attribute.</p>
</section>
4. Iframe HTML
The <iframe> HTML element allows you to embed another webpage within the current page, enabling seamless content integration from external sources.
What this code does: Embeds an external page inside a fixed-size frame using the <iframe> element.
<!-- Iframe HTML -->
<iframe src="https://www.academicblock.net" width="400" height="390"></iframe>
5. Alt Attribute
The alt attribute in HTML provides alternative text for images, improving accessibility and displaying text if the image fails to load.
What this code does: Shows how alt text is displayed when an image cannot load, which also helps accessibility and SEO.
<!-- Alt Attribute -->
<img src="image.jpg" alt="Description of your image will appear like this text.">
6. Semantic HTML
Semantic HTML tags like <article> clearly define the purpose of content, improving readability and SEO by giving meaning to the structure of a webpage.
What this code does: Wraps a title and paragraph in an <article> element so the browser and search engines understand it as standalone content.
<!-- Semantic HTML -->
<article>
<h2>Article Title</h2>
<p>This article demonstrates semantic html enclosed in paragraph tags.</p>
</article>
7. JavaScript in HTML Code
JavaScript in HTML adds interactivity and dynamic behavior to webpages by embedding scripts within <script> tags.
What this code does: Attaches an inline onclick handler so clicking the button shows an alert message.
<!-- JavaScript in HTML -->
<button onclick="alert('JavaScript in html code works!')">Click Me</button>
8. 3D Elements for Website
HTML combined with CSS transform: rotate enables simple 3D-like effects by rotating elements along the X, Y, or Z axis, adding depth and visual appeal to web pages.
What this code does: Rotates a bordered box slightly on the Z-axis using CSS transform for a simple 3D-like effect.
<!-- 3D Elements -->
<div style="transform: rotateZ(10deg); border: 1px solid #000; padding: 20px;">
3D Effect.
</div>
9. Internal HTML Links
Internal HTML links use the <a> tag with a hash (#) to navigate to specific sections within the same website for smooth on-page navigation.
What this code does: Creates a normal hyperlink that points to another page on the same site (internal navigation between pages).
<!-- Internal HTML Links -->
<a href="https://www.academicblock.net/matlab-tutorial" class="html anchor">Jump to another Internal Page of Matlab Tutorial</a>
Summary
Mastering html elements and their associated HTML Attributes—from the historical blink element to modern semantic html—empowers you to build accessible and dynamic websites. This concise guide, featuring a comprehensive Html elements list with examples, covers practical use cases such as radio buttons, iframe html, html anchor, and mailto html link implementations. Explore these examples and enhance your web development skills.
Questions and Answers related to HTML Elements
HTML elements are the building blocks of web pages. They define the structure and content, including headings, paragraphs, images, links, and more. Each element is enclosed in tags, such as <p> for paragraphs. Elements can be nested, styled with CSS, and manipulated with JavaScript, enabling dynamic web experiences.
An HTML tag is the markup enclosed in angle brackets, such as <h1>, while an HTML element consists of the opening tag, content, and closing tag. For example, <p>Hello</p> is an element where <p> is the tag, and “Hello” is the content.
HTML has over 100 elements, including common ones like <div>, <span>, <p>, <a>, <img>, <h1>-<h6>, <ul>, <li>, and <table>. These elements define text structure, images, links, lists, and more, forming the foundation of web design.
Beginners should start with <html>, <head>, <title>, <body>, <p>, <a>, <img>, <h1>-<h6>, <ul>, <li>, and <table>. These elements help structure and display content, enabling basic web page development.
The <body> tag contains visible web page content, including <p> (paragraphs), <h1>-<h6> (headings), <a> (links), <img> (images), <ul> (unordered lists), and <table> (tables).
Essential tags include <html>, <head>, <title>, <body>, <p>, <h1>-<h6>, <a>, <img>, <ul>, <li>, and <table>. These structure and present content effectively.
Attributes modify elements, providing additional information. For example, <img src=”image.jpg” alt=”Description”> uses alt for accessibility and SEO benefits.
The <a> element links to pages using the href attribute. Example: <a href=”https://example.com”>Visit</a>. It can also link internally using IDs.
Radio buttons are created using <input type=”radio” name=”option”>. Grouping them with the same name ensures only one selection.
Elements like <div> (containers), <section>, <article>, <nav>, and <aside> help structure content semantically, improving readability and accessibility.
🧪 Test Your HTML Code
Edit the HTML code on the left and click “Run Code” to see the result on the right.
Click “Run Code” to see the result here.