Meta tags:
description= Usa la pseudo-clase CSS :empty para seleccionar elementos vacíos. Lee sobre la pseudo-clase y practica con ejemplos.;
Headings (most frequently used words):
con, empty, ejemplo, del, selector, la, etiqueta, css, pseudo, clase, qué, se, considera, vacío, sintaxis, ocultar, elementos, vacíos, compatibilidad, navegadores, versión, práctica, el, problema, los, espacios, en, blanco, div,
Text of the page (most frequently used words):
css (34), border (34), empty (29), text (28), font (20), color (19), con (18), style (18), grid (18), que (16), width (16), aprender (15), #elementos (15), background (14), los (13), html (13), column (13), the (12), para (10), type (10), break (10), top (9), right (9), left (9), bottom (9), image (9), animation (9), texto (8), del (8), pseudo (8), clase (8), div (8), position (8), stroke (8), contenido (7), elemento (7), padding (7), espacios (7), overflow (7), decoration (7), offset (7), flex (7), vacíos (6), vacío (6), page (6), lorem (6), ipsum (6), height (6), title (6), blanco (6), align (6), margin (6), variant (6), w3docs (5), copiar (5), has (5), and (5), not (5), only (5), ejemplo (5), por (5), after (5), before (5), transition (5), line (5), last (5), outline (5), radius (5), child (5), formatter (5), generator (4), práctica (4), ocultar (4), sintaxis (4), qué (4), selectors (4), level (4), mismo (4), alert (4), display (4), box (4), body (4), typesetting (4), industry (4), dummy (4), selector (4), head (4), etiqueta (4), content (4), como (4), mode (4), transform (4), fill (4), size (4), list (4), template (4), row (4), gap (4), rule (4), nth (4), first (4), json (3), code (3), encoder (3), editor (3), cuestionarios (3), ejercicios (3), php (3), javascript (3), ejemplos (3), navegadores (3), afecta (3), sin (3), hijos (3), tienen (3), hijo (3), class (3), when (3), uso (3), simply (3), una (3), está (3), cierre (3), word (3), wrap (3), spacing (3), range (3), origin (3), justify (3), items (3), max (3), letter (3), columns (3), auto (3), direction (3), clip (3), ver (3), string (3), tools (3), todos (2), italiano (2), português (2), español (2), français (2), русский (2), deutsch (2), english (2), beautifier (2), diff (2), password (2), herramientas (2), python (2), java (2), git (2), libros (2), fragmentos (2), compatibilidad (2), versión (2), considera (2), this (2), enabled (2), disabled (2), dom (2), representa (2), mantiene (2), comportamiento (2), coincidiendo (2), ningún (2), comentarios (2), anidados (2), elimina (2), none (2), colapsar (2), pruébalo (2), dummying (2), printing (2), been (2), standard (2), ever (2), since (2), 1500s (2), unknown (2), printer (2), took (2), galley (2), scrambled (2), make (2), specimen (2), book (2), survived (2), five (2), centuries (2), but (2), also (2), leap (2), into (2), electronic (2), remaining (2), essentially (2), unchanged (2), example (2), document (2), doctype (2), otro (2), código (2), esta (2), más (2), plantilla (2), entre (2), las (2), consulta (2), seleccionar (2), cuentan (2), problema (2), sigue (2), apertura (2), nada (2), página (2), modo (2), visibility (2), unicode (2), timing (2), function (2), duration (2), delay (2), shadow (2), rendering (2), skip (2), perspective (2), inside (2), anchor (2), path (2), object (2), blend (2), min (2), rows (2), start (2), end (2), flow (2), feature (2), counter (2), count (2), repeat (2), read (2), hash (2), 2026, derechos, reservados, hecho, desarrolladores, idioma, política, privacidad, contacto, acerca, empresa, try, tutoriales, gratuitos, web, desde, 2014, next, previous, yes, was, helpful, comprobar, filtro, eliminar, mayúsculas, incluyendo, nodos, únicamente, absolutamente, invalidan, coincidencia, información, compatible, modernos, fue, definida, dos, especificaciones, ambas, ahora, diseño, mientras, renderiza, normalidad, esto, cargo, resultado, visual, lugar, requerir, lógica, lado, servidor, omitir, saved, that, should, disappear, message, frecuente, mundo, real, llegó, deje, margen, borde, fondo, relleno, combina, ccc, 8ebf42, 200, declarations, razón, común, funciona, formatea, salida, deja, etiquetas, necesitas, coincidir, contienen, solo, aún, experimental, marcado, otras, condiciones, blank, does, match, newline, spaces, are, matches, truly, contiene, tabulaciones, saltos, línea, pseudoelementos, generado, porque, ese, forma, parte, automático, posibles, siempre, coinciden, img, directamente, coincide, cuando, hay, explica, cómo, determina, habitual, confunde, mayoría, personas, práctico, bloques, ejecutables, puedes, editar, selecciona, absoluto, útil, dar, estilo, contenedores, provienen, cms, api, dentro, puedas, espacio, dejarían, usa, lee, sobre, practica, zoom, index, writing, will, change, widows, white, space, vertical, user, select, bidi, property, underline, orientation, indent, ink, combine, upright, table, layout, tab, linecap, dashoffset, dasharray, speak, shape, outside, scrollbar, scroll, behavior, resize, quotes, pointer, events, place, orphans, order, opacity, rotate, distance, fit, mix, media, lines, clamp, keyframes, isolation, initial, import, hyphens, hanging, punctuation, areas, area, weight, numeric, ligatures, east, asian, caps, alternates, stretch, language, override, adjust, kerning, values, settings, family, face, float, shrink, grow, basis, filter, cells, cursor, reset, increment, span, clear, charset, caret, caption, side, sizing, source, slice, outset, collapse, block, bleed, attachment, backface, appearance, play, state, name, iteration, self, all, properties, visited, valid, target, selection, scope, root, required, write, placeholder, out, optional, link, lang, invalid, indeterminate, hover, fullscreen, focus, dir, default, checked, active, selectores, propiedades, css3, guía, flexbox, guides, gradientes, nombres, colores, tablas, links, introducción, basic, iniciar, sesión, buscar, formatters, url, reverse, sha256, md5, length, calculator, colors, hsl, hex, mixer, converter, picker, general, cursos, aprende,
Text of the page (random words):
css empty pseudo clase aprende css w3docs w3docs libros aprender html aprender css aprender javascript aprender git aprender java aprender php aprender python cursos cuestionarios ejercicios fragmentos herramientas general tools html editor password generator html encoder code diff json beautifier ver los 13 color tools color picker color converter color mixer color hex colors hsl ver los 10 string tools string length calculator md5 hash generator sha256 hash generator string reverse url encoder ver los 19 code formatters javascript formatter css formatter html formatter json formatter php formatter buscar en w3docs k es english en deutsch de русский ru français fr español es português pt italiano it iniciar sesión aprender css css basic introducción a css uso de css sintaxis css css id y class texto en css css font css links tablas css css border css padding css margin nombres de colores css gradientes css css guides guía de flexbox propiedades de css3 css selectors selectores css active after before checked default dir disabled empty enabled first child first letter first line first of type focus fullscreen hover in range indeterminate invalid lang last child last of type link not nth child nth last child nth last of type nth of type only child only of type optional out of range placeholder read only read write required root scope selection target valid visited css properties align content align items all animation align self animation delay animation direction animation duration animation fill mode animation iteration count animation name animation play state animation timing function appearance backface visibility background background attachment background blend mode background clip background color background image background origin background position background position x background position y background repeat background size bleed block overflow border border bottom border bottom color border bottom left radius border bottom right radius border bottom style border bottom width border collapse border color border image border image outset border image repeat border image slice border image source border image width border left border left color border left style border left width border radius border right border right color border right style border right width border spacing border style border top border top color border top left radius border top right radius border top style border top width border width bottom box decoration break box shadow box sizing break after break before break inside caption side caret color charset clear clip clip path color columns column count column fill column gap column rule column rule color column rule style column rule width column span column width content counter increment counter reset cursor direction display empty cells fill filter flex flex basis flex direction flex flow flex grow flex shrink flex wrap float font font face font display font family font feature settings font feature values font kerning font size font size adjust font language override font stretch font style font variant font variant alternates font variant caps font variant east asian font variant ligatures font variant numeric font weight grid grid area grid auto columns grid auto flow grid auto rows grid column grid column end grid column gap grid column start grid gap grid row grid row end grid row gap grid row start grid template grid template areas grid template columns grid template rows hanging punctuation height hyphens image rendering import initial letter isolation justify content justify items keyframes left letter spacing line break line clamp line height list style list style image list style position list style type margin margin bottom margin left margin right margin top max height max lines max width media min height min width mix blend mode object fit object position offset offset anchor offset distance offset path offset position offset rotate opacity order orphans outline outline color outline offset outline style outline width overflow overflow anchor overflow wrap overflow x overflow y padding padding bottom padding left padding right padding top page break page break after page break before page break inside perspective perspective origin place items pointer events position quotes resize right scroll behavior scrollbar shape outside speak stroke stroke dasharray stroke dashoffset stroke linecap stroke width tab size table layout text align text align last text combine upright text decoration text decoration color text decoration line text decoration skip text decoration skip ink text decoration style text fill color text indent text justify text orientation text overflow text rendering text shadow text stroke text stroke color text stroke width text transform text underline position top transform transform origin transform style transition transition delay transition duration transition property transition timing function unicode bidi unicode range user select vertical align visibility white space widows width will change word break word spacing word wrap writing mode z index zoom css empty pseudo clase usa la pseudo clase css empty para seleccionar elementos vacíos lee sobre la pseudo clase y practica con ejemplos la pseudo clase css empty selecciona elementos que no tienen ningún hijo en absoluto ni elementos hijo ni contenido de texto es más útil para dar estilo u ocultar contenedores vacíos que provienen de una plantilla cms o api sin nada dentro de modo que puedas colapsar el espacio que de otro modo dejarían en la página esta página explica cómo empty determina si un elemento está vacío el problema habitual con los espacios en blanco que confunde a la mayoría de las personas un uso práctico para ocultar bloques vacíos y ejemplos ejecutables que puedes editar qué se considera vacío un elemento coincide con empty cuando entre su etiqueta de apertura y cierre no hay nada ni texto ni comentarios como contenido ni elementos anidados si una etiqueta de cierre sigue directamente a la de apertura p p el elemento está vacío los elementos de cierre automático como hr br e img no tienen posibles hijos por lo que siempre coinciden con empty los pseudoelementos before y after no se cuentan como hijos un elemento con contenido generado por before after sigue coincidiendo con empty porque ese contenido no forma parte del dom el problema con los espacios en blanco los espacios en blanco cuentan como contenido de texto por lo que un elemento no está vacío si contiene espacios tabulaciones o saltos de línea p p matches empty truly empty p p does not match the newline and spaces are text content copiar esta es la razón más común por la que empty no funciona una plantilla que formatea su salida deja espacios en blanco entre las etiquetas si necesitas coincidir con elementos que contienen solo espacios en blanco consulta la pseudo clase blank aún experimental o elimina los espacios en blanco de tu marcado para seleccionar elementos por otras condiciones consulta not sintaxis ejemplo de sintaxis css empty empty css declarations copiar ejemplo del selector empty con la etiqueta p código de ejemplo css empty doctype html html head title title of the document title style p empty width 200 px height 30 px background 8ebf42 style head body h2 empty selector example h2 p lorem ipsum is simply dummy text p p p p lorem ipsum is simply dummy text p body html copiar pruébalo tú mismo ejemplo del selector empty con la etiqueta div otro código de ejemplo css empty doctype html html head title title of the document title style div empty background color ccc padding 15 px width 50 height 50 px style head body h2 empty selector example h2 p lorem ipsum is the dummying text of the printing and typesetting industry lorem ipsum has been the industry s standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book it has survived not only five centuries but also the leap into electronic typesetting remaining essentially unchanged p div div p lorem ipsum is simply dummying text of the printing and typesetting industry lorem ipsum has been the industry s standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book it has survived not only five centuries but also the leap into electronic typesetting remaining essentially unchanged p body html copiar pruébalo tú mismo ocultar elementos vacíos un uso frecuente en el mundo real es colapsar un elemento que llegó vacío para que no deje un margen borde o fondo de relleno combina empty con display none an alert box that should disappear when it has no message alert empty display none copiar ahora div class alert div se elimina del diseño mientras que div class alert saved div se renderiza con normalidad esto mantiene tu css a cargo del resultado visual en lugar de requerir lógica del lado del servidor para omitir el elemento compatibilidad con navegadores y versión empty es compatible con todos los navegadores modernos fue definida en dos especificaciones ambas con el mismo comportamiento selectors level 3 selectors level 4 i información selectors level 4 mantiene el mismo comportamiento para empty que level 3 coincidiendo únicamente con elementos que no tienen absolutamente ningún hijo el texto los comentarios y los elementos anidados invalidan la coincidencia práctica práctica qué representa la pseudo clase empty en css qué representa la pseudo clase empty en css afecta a elementos sin hijos incluyendo nodos de texto afecta a elementos con contenido de texto en mayúsculas es un filtro para eliminar elementos vacíos del dom afecta a elementos sin contenido de texto comprobar was this page helpful yes no previous disabled next enabled on this page qué se considera vacío sintaxis ocultar elementos vacíos compatibilidad con navegadores y versión práctica w3docs tutoriales ejemplos ejercicios fragmentos y cuestionarios gratuitos para la web desde 2014 libros aprender html aprender css aprender javascript aprender git aprender java aprender php aprender python práctica ejercicios cuestionarios editor try it herramientas html editor password generator html encoder code diff json beautifier empresa acerca de contacto política de privacidad idioma english deutsch русский français español português italiano 2026 w3docs todos los derechos reservados hecho para desarrolladores
|