Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

width

Resumen

El descriptor CSS width es una forma reducida para establecer min-width y max-width en el viewport. Definiendo un valor de longitud para viewport se establecerán los dos, anchura mínima y anchura máxima, con el valor definido.

Si se definen dos valores de viewport, el primero corresponderá a la anchura mínima, y el segundo, a la anchura máxima.

Related at-rule@viewport
Valor inicialas each of the properties of the shorthand:
Percentagesas each of the properties of the shorthand:
  • min-width: refer to the width of the containing block
  • max-width: refer to the width of the containing block
Mediavisual, continuous
Valor calculadoas each of the properties of the shorthand:
  • min-width: the percentage as specified or the absolute length
  • max-width: the percentage as specified or the absolute length or none
Canonical orderorder of appearance in the formal grammar of the values

Sintaxis

/* Ejemplo con un valor de viewport: */
@viewport {
    width: 320px;
}

/* Ejemplo con dos valores de viewport: */
@viewport {
    width: 320px, 120px;
}

 

Valores

auto
El valor a usar es calculado con los valores de otros descriptores CSS.
<length>
Un valor <length> de longitud absoluta o relativa no negativa.
<percentage>
Un valor <percentage> del porcentaje relativo a la anchura o altura del viewport inicial, con factor de zoom de 1.0, para longitudes verticales y horizontales respectivamente. No puede ser negativo.

Sintaxis formal

<viewport-length>{1,2}

where
<viewport-length> = auto | <length-percentage>

where
<length-percentage> = <length> | <percentage>

Especificaciones

Especificación Estado Comentarios
CSS Device Adaptation
The definition of '"min-width" descriptor' in that specification.
Working Draft Definición inicial

Compatibilidad de navegadores

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Soporte básico 29 (usando una bandera) No support 10 -ms 11.10
Removido en 15
Reintroducido con una bandera en 16
No support
Característica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Soporte básico 4.4 29 No support 10-ms 11.10
Removido en 15
Reintroducido con una bandera en 16
No support

 

Etiquetas y colaboradores del documento

 Colaboradores en esta página: israel-munoz
 Última actualización por: israel-munoz,