Cargando...

Etiqueta HTML <a> atributo media

Definición

El atributo media especifica el medio/dispositivo para el documento vinculado en el enlace para ser optimizado.

El uso de este atributo se podría utilizar para especificar que la URL que esta vinculada al enlaces esta optimizada para dispositivos como (iPhone) o para medios impresos.

Cabe aclarar que para que este atributo funcione, en la etiqueta <a> se debe especificar el atributo href necesariamente.

Nota: Este atributo es puramente consultivo.

La Sintaxis

La forma de utilizar este atributo es muy sencillo y se haría de la siguiente forma:
<a media="value" href="url">Nombre del enlace</a>

Ejemplo:
<a media="value" href="print and (resolution:300dpi)">
   Desarrollo Web - Vector Latino
</a>

Los valores posibles

Operadores

Value Description
and Especifica un operador AND
not Especifica un operador NOT
, Especifica un operador OR

Dispositivos

Value Description
all (Valor Por Defecto) - Apto para todos los dispositivos.
aural Sintetizadores de voz
braille Dispositivos Braille retroalimentación
handheld Dispositivos de mano (pantalla pequeña, ancho de banda limitado)
projection Proyectores
print Imprimir modo de vista previa / páginas impresas
screen Pantallas de ordenador
tty Teletipos y medios similares usando una cuadrícula de caracteres de paso fijo.
tv Dispositivos de televisión de tipo (baja resolución, limitada habilidad de desplazamiento)

Valores

Value Description
width Specifies the width of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-width:500px)"
height Specifies the height of the  targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (max-height:700px)"
device-width Specifies the width of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-width:500px)"
device-height Specifies the height of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-height:500px)"
orientation Specifies the orientation of the target display/paper.
Possible values: "portrait" or "landscape"
Example: media="all and (orientation: landscape)"
aspect-ratio Specifies the width/height ratio of the targeted display area.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"
device-aspect-ratio Specifies the device-width/device-height ratio of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="screen and (aspect-ratio:16/9)"
color Specifies the bits per color of target display.
"min-" and "max-" prefixes can be used.
Example: media="screen and (color:3)"
color-index Specifies the number of colors the target display can handle.
"min-" and "max-" prefixes can be used.
Example: media="screen and (min-color-index:256)"
monochrome Specifies the bits per pixel in a monochrome frame buffer.
"min-" and "max-" prefixes can be used.
Example: media="screen and (monochrome:2)"
resolution Specifies the pixel density (dpi or dpcm) of the target display/paper.
"min-" and "max-" prefixes can be used.
Example: media="print and (resolution:300dpi)"
scan Specifies scanning method of a tv display.
Possible values are "progressive" and "interlace".
Example: media="tv and (scan:interlace)"
grid Specifies if the output device is grid or bitmap.
Possible values are "1" for grid, and "0" otherwise.
Example: media="handheld and (grid:1)"

Prueba tu mismo

Coloca en la siguiente caja de texto tu código HTML:


Volver a: Etiqueta HTML - Link "<a>"

Referencias

No hay comentarios:

Publicar un comentario

Déjanos tu opinión sobre la entrada a continuación: