CSS:标签rel和media的解释

代码:

media = "screen" rel = "stylesheet"

rel:relations的缩写,是指的关联到的文件是什么。此处是指关联到一个stylesheet

rel = "shortcut icon"和"icon"的区别:

shortcut icon特指浏览器地址栏左侧显示的图标,一般大小为16 x 16, 后缀名为.icon

icon指的是图标,格式可为png,gif,jpeg,尺寸一般为16x16, 24x24, 36x36等

应用代码:

<link rel="shortcut icon" href="..." type="image/x-icon">

rel="apple-touch-icon":是IOS设备的私有标签,使得添加到主屏幕上的网站图标使用指定的图片

各尺寸自适应代码:

默认(老设备):57x57,iPad:72x72,iPhone 4,Retina屏:114x114(原尺寸的2倍)

<linkrel="apple-touch-icon"href="apple-touch-icon-iphone.png"/>

<linkrel="apple-touch-icon"sizes="72x72"href="apple-touch-icon-ipad.png"/>

<linkrel="apple-touch-icon"sizes="114x114"href="apple-touch-icon-iphone4.png"/>

media = 'screen':媒体 = 全屏幕

media用于指定这个CSS用于何种设备

screen:缺省值,计算机屏幕

print:打印机

projection:投影机

aural:扬声器

braille:凸字触觉感知设备

tty:电传打字机

tv:电视机

all:所有输出设备