Learn what HTML elements are, their types, attributes, and how to structure content on a webpage. Step-by-step examples for beginners included.

๐Ÿ“ What Are HTML Elements?

An HTML element is the building block of a webpage. It consists of:

Start Tag โ€“ tells the browser the element type.

Content โ€“ the information or text inside the element.

End Tag โ€“ closes the element.

Example:

<p>This is a paragraph.</p>


<p> โ†’ start tag

This is a paragraph. โ†’ content

</p> โ†’ end tag

๐Ÿ”น Empty Elements

Some elements do not have content and do not require an end tag. These are called empty elements.

Example:

<br>
<img src="image.jpg" alt="Example Image">

๐Ÿ”น Common HTML Elements
Element Description
<h1> to <h6> Headings
<p> Paragraph
<a> Hyperlink
<img> Image
<ul>, <ol>, <li> Lists
<div> Block container
<span> Inline container
๐Ÿ”น HTML Attributes

Elements can have attributes that provide extra information.

Example:

<a href="https://www.faulink.com/&quot; target="_blank">Visit Faulink</a>
<img src="faulink-logo.png" alt="Faulink Logo">


href โ†’ URL for links

target="_blank" โ†’ open in new tab

src โ†’ image source

alt โ†’ alternative text

๐Ÿ”น Nesting HTML Elements

HTML elements can contain other elements. This is called nesting.

Example:

<div>
<h2>Welcome to Faulink IT</h2>
<p>Learn Web Development and Programming.</p>
<a href="https://www.faulink.com/&quot; target="_blank">Visit Website</a>
</div>

๐Ÿ”— Links Za Kujifunza Zaidi

๐ŸŒ Faulink Official Website
https://www.faulink.com/

๐Ÿ“˜ Jifunze Web Design & Programming
https://www.faulink.com/excel_mifumo.php

๐Ÿ“ฒ WhatsApp kwa Msaada wa Haraka
https://wa.me/255693118509