Once you understand the basic HTML document structure, you start filling pages with elements — the building blocks that create visible layout and content. This section covers four of the most commonly used element categories in web development: layout containers, data tables, images, and embedded media. All examples come directly from the course’s web week source files.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/marioaje/Python/llms.txt
Use this file to discover all available pages before exploring further.
Div Containers
The<div> element is a generic block-level container. By itself it renders nothing — it’s invisible. Its power comes from grouping other elements together so you can apply styles, position sections of a page, or target them with JavaScript. The contendores.html source shows two styled <div> blocks stacked vertically, each using inline style attributes to set background and text colors.
semanaweb/contendores.html
<div> wraps a different type of content — a heading, a paragraph, an image, and a video embed — and the inline style on the first two divs changes how those sections appear. Divs are also fully nestable: you can place divs inside divs to build multi-column layouts and card-based designs.
The
style attribute used above is called an inline style. It works, but it mixes presentation directly into your HTML, which makes large pages harder to maintain. In production projects you would move those rules into a separate CSS stylesheet (a .css file linked via <link rel="stylesheet" href="styles.css"> in the <head>). Inline styles are useful for quick demos and prototypes.Tables
HTML tables display data in rows and columns using three core tags:<table>— the wrapper for the entire table<tr>(table row) — defines a horizontal row<th>(table header) — a cell in the header row; bold and centered by default<td>(table data) — a regular data cell
tablas.html source builds a simple two-column color catalog with one header row and six data rows:
semanaweb/tablas.html
<tr> uses <th> cells (Id and Nombre), making it the header row. Every subsequent <tr> uses <td> cells for the actual data. Browsers will bold and center <th> content automatically, visually distinguishing the header from the body rows. For larger tables, HTML also provides <thead>, <tbody>, and <tfoot> wrapper elements to add semantic grouping and enable independent scrolling of the body.
Images
The<img> tag embeds an image into the page. It is a self-closing (void) element — it has no closing tag. Its two most important attributes are src (the path or URL of the image file) and alt (a text description of the image). The imagenes.html source loads two course-related PNG files from a local img/ folder:
semanaweb/imagenes.html
<img> uses height and width attributes to constrain its display size to 100 × 100 px. The second loads at its natural dimensions. Both images reference local paths — the course’s img/ folder contains course-related PNG images such as diseno web.PNG and ecommerce.png.
Embedding Videos
HTML does not have a native video-streaming tag for external platforms like YouTube. Instead, you use the<iframe> (inline frame) element, which embeds an entirely separate HTML page — in this case YouTube’s video player — inside a rectangular region of your page. The course’s videos.html file embeds a YouTube video using the standard embed URL format:
semanaweb/videos.html
<iframe> attributes for a YouTube embed are:
| Attribute | Value | Purpose |
|---|---|---|
width | 560 | Display width of the player in pixels |
height | 315 | Display height of the player in pixels |
src | https://www.youtube.com/embed/<VIDEO_ID> | The embed URL — replace <VIDEO_ID> with the video’s ID from its regular YouTube URL |
title | "YouTube video player" | Accessible label for the iframe (important for screen readers) |
frameborder | 0 | Removes the default visible border around the iframe |
allowfullscreen | (boolean) | Enables the full-screen button inside the player |
<iframe> pattern also appears inside a <div> container in contendores.html, showing how you would wrap an embedded video in a layout block to position and size it alongside other page content.
Summary of HTML Elements
| Element | Type | Primary Use |
|---|---|---|
<div> | Container | Groups and wraps other elements for layout and styling |
<table> | Data | Displays tabular data in rows and columns |
<tr> | Table row | Defines a single row inside a <table> |
<th> | Table header cell | Bold, centered header cell in a <tr> |
<td> | Table data cell | Standard data cell in a <tr> |
<img> | Media | Embeds a raster or vector image; self-closing |
<iframe> | Embed | Embeds an external page or media player (e.g. YouTube) inline |