Academic Block

Academic Block logo
HTML Tutorial

HTML Elements and Their Functions

Explore HTML Elements, Attributes, and SEO Benefits

In this tutorial, we cover a variety of html elements and HTML Attributes that define your web content. Our Html elements list includes examples such as the blink element, html anchor links, and even iframe html for embedding external pages. Learn how semantic html enhances accessibility and discover concise examples demonstrating radio buttons, blockquote style, and more.

1. Blockquote Style Example

The <blockquote> HTML element is used to define a section that is quoted from another source, typically displayed with indentation for emphasis.

            <!-- Blockquote Style Example -->
<blockquote style="border-left: 4px solid #ccc; padding-left: 10px;">
  "A styled blockquote enhances readability."
</blockquote>
          

2. Radio Buttons Example

Radio buttons in HTML allow users to select one option from a predefined set, using the <input type="radio"> element.

            <!-- Radio Buttons Example -->
<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 Example

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.

    <!-- Anchor and Mailto Example -->
<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> <br> <br> <br> <br>
<br> <br> <br> <br> <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 Example

The <iframe> HTML element allows you to embed another webpage within the current page, enabling seamless content integration from external sources.

            <!-- Iframe HTML Example -->
<iframe src="https://www.academicblock.net" width="400" height="390"></iframe>
          

5. Alt Attribute Example

The alt attribute in HTML provides alternative text for images, improving accessibility and displaying text if the image fails to load.

            <!-- Alt Attribute Example -->
<img src="image.jpg" alt="Description of your image will appear like this text.">
          

6. Semantic HTML Example

Semantic HTML tags like <article> clearly define the purpose of content, improving readability and SEO by giving meaning to the structure of a webpage.

            <!-- Semantic HTML Example -->
<article>
  <h2>Article Title</h2>
  <p>This article demonstrates semantic html enclosed in paragraph tags. </p>
</article>
          

7. JavaScript in HTML Code Example

JavaScript in HTML adds interactivity and dynamic behavior to webpages by embedding scripts within <script> tags.

            <!-- JavaScript in HTML Example -->
<button onclick="alert('JavaScript in html code works!')">Click Me</button>
          

8. 3D Elements for Website Example

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.

            <!-- 3D Elements Example -->
<br> <br> <br> <br>
<div style="transform: rotateZ(10deg); border: 1px solid #000; padding: 20px;">
  3D Effect.
</div>
          

9. Internal HTML Links Example

Internal HTML links use the <a> tag with a hash (#) to navigate to specific sections within the same website for smooth on-page navigation.

            <!-- Internal HTML Links Example -->
<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

+ What are HTML elements and how are they used in building web pages? >

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.

+ What is the difference between an HTML tag and an HTML element? >

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.

+ How many HTML elements are available, and which ones are most commonly used? >

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.

+ What are the essential HTML elements every beginner should learn? >

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.

+ What are the basic body elements in an HTML document? >

The <body> tag contains visible web page content, including <p> (paragraphs), <h1>-<h6> (headings), <a> (links), <img> (images), <ul> (unordered lists), and <table> (tables).

+ What are the 12 basic HTML tags that form the foundation of web pages? >

Essential tags include <html>, <head>, <title>, <body>, <p>, <h1>-<h6>, <a>, <img>, <ul>, <li>, and <table>. These structure and present content effectively.

+ How do HTML elements interact with attributes like alt for images? >

Attributes modify elements, providing additional information. For example, <img src=”image.jpg” alt=”Description”> uses alt for accessibility and SEO benefits.

+ What role do anchor elements play in creating internal and external links? >

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.

+ How are form input elements, such as radio buttons, implemented in HTML? >

Radio buttons are created using <input type=”radio” name=”option”>. Grouping them with the same name ensures only one selection.

+ What are the key functions of various HTML elements in organizing content? >

Elements like <div> (containers), <section>, <article>, <nav>, and <aside> help structure content semantically, improving readability and accessibility.

HTML a programming Language MATLAB a programming Language PHP a programming Language C++ a programming Language