From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- files/es/web/css/@media/width/index.html | 124 +++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 files/es/web/css/@media/width/index.html (limited to 'files/es/web/css/@media/width') diff --git a/files/es/web/css/@media/width/index.html b/files/es/web/css/@media/width/index.html new file mode 100644 index 0000000000..a4392047b3 --- /dev/null +++ b/files/es/web/css/@media/width/index.html @@ -0,0 +1,124 @@ +--- +title: width +slug: Web/CSS/@media/width +translation_of: Web/CSS/@media/width +--- +
{{cssref}}
+ +

El width CSS {{cssxref("@media")}} media caracteristica puede ser usada para aplicar estilos basados en el ancho  de el  {{glossary("viewport")}} (o la caja de la pagina, para paged media).

+ +

Syntax

+ +

La característica width es especificada como {{cssxref("<length>")}} valor que representa el ancho de la ventana gráfica. Es una función de rango, lo que significa que también puede usar el prefijo min-width and max-width variantes para consultar valores mínimos y máximos, respectivamente.

+ +

Example

+ +

HTML

+ +
<div>Watch this element as you resize your viewport's width.</div>
+ +

CSS

+ +
/* Exact width */
+@media (width: 360px) {
+  div {
+    color: red;
+  }
+}
+
+/* Minimum width */
+@media (min-width: 35rem) {
+  div {
+    background: yellow;
+  }
+}
+
+/* Maximum width */
+@media (max-width: 50rem) {
+  div {
+    border: 2px solid blue;
+  }
+}
+
+ +

Result

+ +

{{EmbedLiveSample('Example','90%')}}

+ +

Specificaciones

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('CSS4 Media Queries', '#width', 'width')}}{{Spec2('CSS4 Media Queries')}}The value can now be negative, in which case it computes to false.
{{SpecName('CSS3 Media Queries', '#width', 'width')}}{{Spec2('CSS3 Media Queries')}}Initial definition. The value must be nonnegative.
+ +

Navegadores Compatibles

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChrome +

Firefox (Gecko)

+
Internet ExplorerEdgeOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}9.014+{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support56+{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}9.3+
+
-- cgit v1.2.3-54-g00ecf