Saltar al contenido

Tutorial de HTML

Learn HTML from zero to professional. A live editor in every lesson, quizzes and real projects.

Getting Started

  1. 1 ¿Qué es HTML? A beginner-friendly introduction to HTML. Learn what HTML does, how browsers read it, and write your very first lines of markup.
  2. 2 Breve historia de HTML How HTML grew from a short list of tags at CERN into today's Living Standard, what "HTML5" really means, and why every page still starts with a doctype.
  3. 3 Tu primera página web Set up a code editor, save your first .html file and open it in a browser. Learn the basic skeleton that every HTML document starts with.
  4. 4 Ver el código fuente y usar las DevTools Learn the difference between a page's source and its live DOM, inspect and edit elements in DevTools, use the console, test mobile sizes and spot repaired HTML.
  5. 5 Elementos y etiquetas Understand the difference between tags and elements, how to nest elements correctly, and which special elements never need a closing tag.
  6. 6 Atributos Learn how attributes add extra information to HTML elements. Build links with href, show images with src and alt, and use global attributes like id, class, title and lang.
  7. 7 Encabezados y párrafos Structure your text with the six heading levels, paragraphs, line breaks and thematic breaks, and learn why a logical heading outline matters for readers and search engines.
  8. 8 Editores de HTML, Emmet y comentarios Pick a code editor for HTML, type faster with Emmet abbreviations, and learn how HTML comments work, what they are good for and what never to put in them.

Text Content

  1. 9 Dar formato al texto Format text by meaning, not looks. Learn strong vs b, em vs i, plus u, s, mark, small, sub, sup, ins and del, with clear rules for when to use each one.
  2. 10 Citas, referencias y abreviaturas Quote and credit other people's words with blockquote, q and cite, explain abbreviations and terms with abbr and dfn, and handle contact details and text direction.
  3. 11 Código, entrada de teclado y salida de programas Mark up code snippets, keyboard shortcuts, program output and variables with code, pre, kbd, samp and var, and learn to escape < and & inside code samples.
  4. 12 Entidades HTML Learn when you need HTML entities, how named, decimal and hex references work, how to use no-break spaces and soft hyphens, plus a table of common ones.
  5. 13 Símbolos y emojis Add math signs, arrows, currency symbols, Greek letters and emoji to your pages with Unicode, and make sure they display everywhere and work with screen readers.
  6. 14 Codificación de caracteres y UTF-8 Understand bytes vs characters, ASCII, Windows-1252, Unicode and UTF-8, where to put meta charset, and how to diagnose and fix garbled text known as mojibake.
  7. 15 Fechas y horas, valores de datos y texto ruby Give dates, times and numbers a machine-readable form with time and data, control line breaks in long words with wbr, and annotate East Asian text with ruby.

Links and Navigation

  1. 16 Enlaces en profundidad Master the HTML a element. Learn the kinds of href values, how to write link text people can trust, image links, the title attribute and when to use a button.
  2. 17 Rutas de archivo y URL Learn how URLs are built and how browsers resolve relative paths like ./ and ../, root-relative paths and absolute URLs, with folder examples and the base element.
  3. 18 Destinos de enlaces y saltos de página Control where links open with target, keep new tabs safe with rel="noopener noreferrer", and jump to exact sections with fragment links, :target and back-to-top links.
  4. 19 Enlaces de correo, teléfono y descarga Create email links with subject and body, phone and SMS links, and download links. Learn hreflang, type and the rel values nofollow, sponsored and ugc.
  5. 20 Crear menús de navegación Build accessible navigation with the nav element and lists. Mark the current page with aria-current, and add breadcrumbs, skip links, pagination and footer links.
  6. 21 Codificación de URL Learn why URLs need percent-encoding, which characters are reserved, %20 versus + for spaces, how UTF-8 encodes non-English text, and how encodeURIComponent works.

Lists

  1. 22 Listas Learn how to build bulleted and numbered lists with ul, ol and li, how to choose the right one, and how to change bullets and numbers with list-style-type.
  2. 23 Opciones de las listas ordenadas Control numbering in HTML ordered lists. Start at any number, count down with reversed, choose letters or Roman numerals with type, and set item numbers with value.
  3. 24 Listas de descripción Use dl, dt and dd to build glossaries, FAQs and key-value details. Learn how to group several terms and descriptions, wrap groups in div and style them.
  4. 25 Listas anidadas Learn how to nest HTML lists correctly inside li elements, build outlines, mix ordered and unordered lists, number items 1.1 and 1.2, and avoid common mistakes.

Tables

  1. 26 Tablas Build your first HTML tables with table, tr, td and th. Learn how rows and cells form a grid, when a table is the right choice, and why tables are never for layout.
  2. 27 Encabezados, secciones y títulos de tabla Give your tables real structure with th and scope, a caption that names the table, and thead, tbody and tfoot row groups for headers, data and totals.
  3. 28 Combinar filas y columnas Merge table cells with colspan and rowspan. Learn to plan the grid on paper first, count cells correctly, and avoid the overlapping cells that break table layouts.
  4. 29 Grupos de columnas Use colgroup and col to describe and style whole table columns. Learn the span attribute, where column groups go, and the four CSS properties that work on columns.
  5. 30 Dar estilo a las tablas con CSS Turn plain HTML tables into clear, readable data with CSS. Borders and border-collapse, padding, alignment, zebra rows, hover, sticky headers and scrolling on small screens.
  6. 31 Tablas accesibles Make data tables work for screen-reader users. Connect cells to headers with scope and the headers attribute, describe tables well, and avoid nested and layout tables.

Images and Media

  1. 32 Imágenes Add images with the HTML img element. Write useful alt text, set width and height to stop layout shift, pick the right format and lazy-load images.
  2. 33 Imágenes adaptables Serve the right image to every screen with srcset, sizes and the picture element. Learn w and x descriptors, format fallbacks and art direction.
  3. 34 Imágenes de fondo en páginas HTML Add background images with CSS, control size, position and repeat, layer gradients for readable text, and learn when to use img instead of a background.
  4. 35 Figuras y leyendas Use figure and figcaption to caption images, code samples, quotes and charts. Learn when content is a figure and how alt text and captions differ.
  5. 36 Mapas de imagen Make parts of one image clickable with map and area. Learn rect, circle and poly coordinates, accessible alt text, and a responsive SVG alternative.
  6. 37 Favicons e iconos de aplicación Add a favicon with link rel="icon", use SVG and dark-mode icons, and set up apple-touch-icon and a web app manifest. A minimal, modern set of icon files.
  7. 38 Vídeo Embed video with the HTML video element. Use controls, multiple sources, a poster image, autoplay rules, muted, loop, playsinline, preload and sizing.
  8. 39 Audio Play sound with the HTML audio element. Add controls, offer MP3 and Ogg sources, understand autoplay rules, loop and mute, and start audio from JavaScript.
  9. 40 Subtítulos y subtitulado Add captions and subtitles to video with the track element and WebVTT files. Learn kind, srclang, label and default, cue timing, settings and styling.
  10. 41 Iframes Embed one web page inside another with the HTML iframe element. Learn src, srcdoc, title, sandbox, allow, loading="lazy", referrerpolicy and framing rules.
  11. 42 Incrustar videos, mapas y otro contenido Embed videos, maps and other third-party content with iframes. Make embeds responsive, protect privacy, and see where embed and object fit today.

Page Structure and Layout

  1. 43 Elementos de bloque y en línea Learn the difference between block and inline elements, how they flow on the page, which elements can nest inside which, and when inline-block is the right choice.
  2. 44 Div y span Learn what div and span do, how they group content for CSS and JavaScript, and when a semantic element like section, nav or button is the better choice.
  3. 45 Clases Use the class attribute to group elements for CSS and JavaScript. Learn multiple classes, class selectors, classList methods and naming conventions that scale.
  4. 46 IDs Give elements unique ids for page jumps, form labels and JavaScript. Learn the rules for valid ids, why to be careful with id selectors in CSS, and getElementById.
  5. 47 Elementos semánticos Learn the HTML semantic elements header, nav, main, article, section, aside, footer, hgroup and search, and how they create landmarks for assistive tech.
  6. 48 Diseño de página Build a complete page layout from semantic HTML elements, then arrange it with CSS Flexbox and Grid, including a footer that sticks to the bottom.
  7. 49 Diseño web adaptable (responsive) Make pages that work on every screen. Learn the viewport meta tag, fluid widths, flexible images, media queries, mobile-first CSS and fluid type with clamp().

The Head, Metadata and SEO

  1. 50 El elemento head Learn what belongs in the HTML head element (title, meta, link, style, script, base and noscript) and the order that helps pages load fast and read well.
  2. 51 Títulos y descripciones de página Write page titles and meta descriptions that work for people and search results. Learn about length, uniqueness, branding and how search engines use them.
  3. 52 Etiquetas meta A practical guide to HTML meta tags: charset, viewport, description, robots, theme-color, color-scheme, referrer and http-equiv, plus the old tags you can drop.
  4. 53 Vistas previas al compartir en redes sociales Control how your pages look when shared on social networks and chat apps with Open Graph and X card tags. Learn image sizes, fallbacks and how to test.
  5. 54 Datos estructurados Describe your pages to machines with schema.org structured data. Write JSON-LD and microdata, learn about rich results, and validate your markup.
  6. 55 Cargar recursos de forma eficiente Speed up your pages from the HTML head. Learn render-blocking resources, defer and async, preconnect, preload, modulepreload, prefetch and fetchpriority.
  7. 56 Lista de verificación SEO para HTML A practical HTML SEO checklist: titles, headings, canonical URLs, robots rules, hreflang, links, images and sitemaps, with a script that audits a page.

CSS and JavaScript in HTML

  1. 57 El atributo style Learn the HTML style attribute and CSS declaration syntax, try common properties for text, color, spacing and borders, and see when inline styles are the wrong tool.
  2. 58 Colores Write colors with names, hex codes, rgb() and hsl(), add transparency with alpha, reuse colors with currentColor and check text contrast for readability.
  3. 59 Cómo añadir CSS a HTML Compare the three ways to add CSS to HTML (inline, the style element and external stylesheets), see how the cascade picks a winner and load CSS per media type.
  4. 60 Añadir JavaScript Add JavaScript to HTML with inline and external script elements, choose where to place them, compare defer, async and type="module", and use noscript fallbacks.
  5. 61 Atributos de evento y oyentes de eventos Respond to clicks, typing and other events with HTML event attributes like onclick, learn why addEventListener is better, and use the event object.
  6. 62 El Modelo de Objetos del Documento Learn how the browser turns HTML into the DOM tree, find elements with querySelector, change text safely, create elements and work with attributes and classList.

Forms

  1. 63 Formularios Learn how HTML forms collect input, how the browser turns fields into name=value pairs, when to use GET or POST, and how to handle submit in JavaScript.
  2. 64 Tipos de input A guided tour of every HTML input type, from text, email and number to date, color, file and range, with what each one does on desktop and mobile.
  3. 65 Labels, fieldsets y legends Give every form control a proper name with label, group related fields with fieldset and legend, and learn how browsers work out a control's accessible name.
  4. 66 Casillas de verificación y botones de opción Learn how checkboxes and radio buttons submit their values, how to build groups, how to make a choice required, and how to restyle them with accent-color.
  5. 67 Menús desplegables y sugerencias Build drop-down menus with select, option and optgroup, allow multiple choices, add a required placeholder option, and offer typing suggestions with datalist.
  6. 68 Áreas de texto y botones Collect longer text with textarea (rows, cols, maxlength, wrap) and master buttons, including submit, reset and button types, button vs input, and formaction.
  7. 69 Atributos de input Fine-tune form inputs with value, placeholder, readonly, disabled, min, max, step, pattern, autocomplete, inputmode, enterkeyhint and other input attributes.
  8. 70 Atributos de formulario Configure the form element itself with action, method, target, enctype for file uploads, autocomplete, novalidate, name and accept-charset.
  9. 71 Validación de formularios Let the browser check input with required, type, min, max, pattern and length, style errors with :user-invalid, and add custom rules with the validation API.
  10. 72 Output, meter y progress Show calculated results with output, measurements within a known range with meter, and task completion with progress, including indeterminate progress bars.

Interactive Elements

  1. 73 Secciones desplegables con details Build collapsible sections and accordions with details and summary, open them by default, group them with name, react to the toggle event and style the marker.
  2. 74 Diálogos y modales Build accessible modal and non-modal dialogs with the dialog element, showModal and close, method="dialog" forms, returnValue, ::backdrop and focus handling.
  3. 75 Popovers Use the popover attribute to build menus, info panels and notifications. Learn auto vs manual popovers, popovertarget, toggle events and when to use dialog.
  4. 76 Atributos globales Learn the HTML global attributes that work on every element, from id, class and lang to hidden, inert, contenteditable, tabindex, dir and translate.
  5. 77 Atributos de datos personalizados Store your own data on HTML elements with data-* attributes, read and write it through JavaScript's dataset, and style elements with CSS attribute selectors.
  6. 78 Plantillas y componentes web Reuse markup with the template element, then build your own HTML tags with custom elements, encapsulate styles with shadow DOM and fill them using slots.
  7. 79 Contenido editable: contenteditable, spellcheck e inputmode Make any element editable with contenteditable, control spell checking, and pick the right mobile keyboard with inputmode, enterkeyhint and autocapitalize.

Graphics

  1. 80 Conceptos básicos de SVG Draw sharp, scalable graphics with inline SVG. Learn the coordinate system and viewBox, the basic shapes, fill and stroke, and when to use img instead.
  2. 81 Trazados, texto y degradados en SVG Draw any shape with SVG path commands, add real text, fill shapes with linear and radial gradients, reuse parts with g and use, and make SVG accessible.
  3. 82 Recorte, máscaras, filtros y animación en SVG Cut shapes with clipPath, fade them with masks, blur, tint and distort them with SVG filter primitives, and animate SVG with SMIL elements or CSS animations.
  4. 83 Fundamentos de canvas Get started with the HTML canvas element. Draw rectangles with the 2D context, set fill and stroke styles, size the canvas sharply and provide fallback content.
  5. 84 Dibujar y animar con canvas Go beyond rectangles on the HTML canvas. Draw paths and arcs, write text, place images with drawImage, paint gradients and animate with requestAnimationFrame.
  6. 85 Matemáticas con MathML Write mathematical formulas directly in HTML with MathML. Learn the math element, mi, mn, mo, mrow, fractions, powers, roots, display math and browser support.

Web APIs

  1. 86 Introducción a las Web API Learn what browser Web APIs are, how to detect whether a feature exists, how permission prompts and secure contexts work, and how to read promise-based code.
  2. 87 Geolocalización Get the user's location with the Geolocation API. Learn getCurrentPosition, watchPosition, the options object, every error code, permissions and HTTPS.
  3. 88 Arrastrar y soltar Build drag and drop with HTML and JavaScript. Learn the draggable attribute, the drag events, dataTransfer, drop zones and how to accept dropped files.
  4. 89 Archivos, subida de archivos y la API FileReader Let users pick files with input type=file, read them with File, Blob and FileReader, preview images with object URLs and send uploads with FormData.
  5. 90 Web Storage Save data in the browser with localStorage and sessionStorage. Learn the API, storing objects as JSON, the storage event, size limits and privacy rules.
  6. 91 Web Workers Keep your page responsive with Web Workers. Learn how to start a worker, exchange messages with postMessage, handle errors and stop a worker with terminate.
  7. 92 Observadores de intersección, redimensionado y mutación Watch elements without polling: IntersectionObserver for lazy reveal and sticky detection, ResizeObserver for size changes, MutationObserver for DOM edits.
  8. 93 APIs de History, Location y URL Read and change the address bar from JavaScript. Learn the URL and URLSearchParams classes, the location object, pushState and popstate, and hash-based routing.
  9. 94 Eventos enviados por el servidor Stream live updates from a server with Server-Sent Events. Learn EventSource, the text/event-stream format, named events, IDs and automatic reconnection.
  10. 95 WebSockets Learn the WebSocket API for two-way, real-time messaging. Open a connection, send and receive data, handle close codes, and choose between WebSockets, SSE and fetch.
  11. 96 IndexedDB Store large amounts of structured data in the browser with IndexedDB. Learn databases, versions, object stores, transactions, indexes, cursors and key ranges.
  12. 97 Mensajería entre documentos con postMessage Send data between a page and its iframes or popups with window.postMessage. Learn targetOrigin, event.origin checks, structured cloning and MessageChannel.
  13. 98 Peticiones entre orígenes y CORS Understand the same-origin policy and CORS. Learn simple and preflighted requests, credentials, opaque responses, the crossorigin attribute and how to read CORS errors.
  14. 99 Progressive Web Apps: manifiesto y service workers Turn a website into an installable app. Write a web app manifest, register a service worker, cache files for offline use and pick a caching strategy.
  15. 100 APIs Web Share, Clipboard y Notifications Share content through the system share sheet, copy and paste with the async Clipboard API, and ask for Notification permission the right way, with fallbacks.
  16. 101 Visibilidad de la página, pantalla completa y bloqueo de pantalla activa React when a tab is hidden with the Page Visibility API, take over the screen with the Fullscreen API, and keep a device awake with Screen Wake Lock.
  17. 102 Cámara, micrófono y MediaRecorder Capture live video and audio with getUserMedia, handle permissions and errors, record streams with MediaRecorder, and play back or download the result.
  18. 103 Fundamentos de la Web Audio API Generate and shape sound with AudioContext, oscillators, gain nodes and filters. Build a small synthesizer and draw its waveform with an analyser.
  19. 104 Síntesis y reconocimiento de voz Make the browser speak with speechSynthesis and listen with SpeechRecognition. Pick voices, control rate and pitch, handle events, and design for privacy.

Accessibility and Best Practices

  1. 105 Fundamentos de accesibilidad Learn who accessibility helps, how screen readers read your HTML, and the habits that matter most, from semantic elements and alt text to labels and contrast.
  2. 106 Roles, estados y propiedades ARIA Learn when ARIA helps and when it hurts. Use roles, accessible names, descriptions, aria-expanded and live regions correctly, following the first rule of ARIA.
  3. 107 Acceso por teclado y foco Make every control reachable without a mouse. Learn tab order, tabindex 0 and -1, visible focus with :focus-visible, skip links, inert and focus management.
  4. 108 Guía de estilo de HTML Write HTML that is easy to read and maintain, with conventions for the doctype, lowercase names, quoting, indentation, optional tags, file names and comments.
  5. 109 Validar tu HTML Check your markup with the W3C Nu HTML Checker and editor linters, fix the most common validation errors, and see how browsers quietly repair broken HTML.
  6. 110 HTML frente a XHTML Learn how HTML and XHTML differ, the strict rules of the XML syntax, why the MIME type decides how a page is parsed, and old versus modern doctypes.
  7. 111 Funciones obsoletas y en desuso Recognize obsolete HTML such as font, center, big, tt, acronym, frames, marquee and presentational attributes, and learn their modern replacements.
  8. 112 HTML de carga rápida Make pages load fast with lean HTML, image dimensions, lazy loading, non-blocking scripts, a smaller DOM, compression and caching, measured by Core Web Vitals.
  9. 113 Seguridad en HTML: CSP, sandbox y Subresource Integrity Harden your pages with HTML features: a Content-Security-Policy meta tag, the iframe sandbox attribute, Subresource Integrity hashes and rel=noopener on links.
  10. 114 Fundamentos del correo electrónico en HTML Learn how HTML email differs from web pages. Build table-based layouts, use inline styles, make bulletproof buttons and plan for the limits of email clients.

Projects

  1. 115 Proyecto: página de perfil personal Build a complete personal profile page with HTML and a little CSS. Add a photo, an introduction, skill lists, quick facts, contact links and a footer, step by step.
  2. 116 Proyecto: artículo de blog Mark up a complete blog post with semantic HTML. Use article, header, time, a table of contents, figure, blockquote, aside and footer, then lay it out with CSS.
  3. 117 Proyecto: formulario de contacto accesible Build an accessible contact form step by step with labels, fieldsets, hints, validation and clear error messages, plus a submit handler that shows the data.
  4. 118 Proyecto: página de aterrizaje adaptable Build a complete responsive landing page with semantic HTML and CSS. Create a header, hero, features grid, pricing table, FAQ accordion, footer and media queries.
  5. 119 Proyecto: página de evento Build a complete event page in HTML with machine-readable dates, a schedule table, speaker cards, a static venue map and an accessible registration form.

Practice and Review

  1. 120 Hoja de referencia de HTML A one-page HTML cheat sheet covering the document skeleton, text, links, lists, images, media, tables, forms, interactive elements and the head, with live examples.
  2. 121 Ejercicios prácticos de HTML Practice HTML with 26 graded exercises, from headings and links to tables, forms, dialogs and accessibility fixes. Each has a live starter editor and a solution.
  3. 122 Preguntas de entrevista de HTML Prepare for front-end interviews with 36 HTML questions and clear answers, grouped by level, covering semantics, forms, media, accessibility, performance and security.