cssをディスプレイサイズで切り替えるメモ

以下は丸ごとcssを切り替える場合
--------------------------------
<link rel="stylesheet" href="./css/s.css" type="text/css"
media="screen and (max-width: 414px)">
<link rel="stylesheet" href="./css/pc.css" type="text/css"
media="screen and (min-width:415px)">

1枚のcss内で画面サイズごとに別の指定をする場合
--------------------------------
@media screen and (max-width:799px) {
#main_contents_box{
width:100%;
height:
z-index:100;
overflow:hidden;
}
}
@media screen and (min-width:800px) {
#main_contents_box{
width:calc(100% - 260px);
height:calc(100vh - 120px);
z-index:100;
position:absolute;
top:60px;
left:260px;
overflow:hidden;
記事id:856 / 2417PV

関連記事


Warning: simplexml_load_file(http://www.jigen.xyz/index.xml) [function.simplexml-load-file]: failed to open stream: HTTP request failed! in /home/session-2/www/02_zatu/system_files/core_sys.php on line 41

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://www.jigen.xyz/index.xml" in /home/session-2/www/02_zatu/system_files/core_sys.php on line 41

Warning: Invalid argument supplied for foreach() in /home/session-2/www/02_zatu/system_files/core_sys.php on line 42