2011年4月6日水曜日

デバイスごとに違うCSSを読み込む

外部のCSSを読み込む際,デバイス毎に違うCSSを読み込む方法.

cssを読み込むlinkタグにmediaを追加
例.

<link rel="stylesheet" type="text/css" href="mobile.css" 
media="screen and (max-device-width: 320px)">
 
min-device-width,max-device-widthによってデバイスの幅で指定や,
orientation:portrait(端末が縦向き),orientation:landscape(端末が横向き) 
などで指定する.
 
 
参考URL

0 件のコメント:

コメントを投稿