Fundamental Elements in HTML

Discover the fundamental elements of HTML, such as headings, paragraphs, lists, links, and images. Learn how to properly structure your web pages with clear and practical examples.
Common Elements and Tags
HTML uses tags to define the structure and content of a web page. Each tag has a specific purpose and consists of an opening tag and a closing tag. Tags can contain attributes that provide additional information about the element.
Containers
Containers are elements that group other elements. The most common is<div>which is used to create sections on a page.
<div>
<h1>Título de la Sección</h1>
<p>Este es un párrafo dentro de un contenedor.</p>
</div>
Headings
These are used for titles and subtitles. They range from<h1>(the most important) until<h6>(the least important).
<h1>Título Principal</h1>
<h2>Subtítulo</h2>
Paragraphs
They are created with the tag<p>
<p>Este es un párrafo de texto.</p>
The label<span>It's an online container used for special text, to wrap part of a text or part of a document.
<p>Este es un <span style="color:blue">ejemplo</span> de etiqueta span.</p>
Links
They are created with the tag<a>and are used to navigate between pages.
<a href="https://www.ejemplo.com">Visita Ejemplo</a>
Images
Inserted with the tag<img>
<img src="imagen.jpg" alt="Descripción de la imagen" />
Attributes
Attributes provide additional information about elements. They are placed within the opening tag.
href
Used in the tag<a>to define the link's URL.
<a href="https://www.ejemplo.com">Visita Ejemplo</a>
src
Used in the tag<img>to define the image path.
<img src="imagen.jpg" alt="Descripción de la imagen" />
alt
Provides alternative text for images, important for accessibility.
<img src="imagen.jpg" alt="Descripción de la imagen" />
-
Structure:Basic structure of an HTML document
-
Semantic tags:Use of semantic tags in HTML
-
More about HTML elements:MDN HTML Element Reference.
💻Get your hands on the code with these simple challenges: