P1:前置作業
P2:header、logo、nav區
P3:social區
一、行動裝置的必需前置語法
各廠家手機解析度 http://screensiz.es/phone
<meta name="viewport" content="width=device-width initial-scale=1.0"> <link rel="stylesheet" href="indexL.css"> <link rel="stylesheet" href="indexM.css" media="only screen and (min-width:768px) and (max-width:1023px)"> <link rel="stylesheet" href="indexS.css" media="only screen and (max-width:767px)">
二、開始HTML結構及前置作業
<header> <h1 id="logo">Wild Life</h1> <nav> <ul id="nav"> <li><a href="#">回到首頁</a></li> <li><a href="#">服務項目</a></li> <li><a href="#">關於我們</a></li> <li><a href="#">聯絡我們</a></li> </ul> </nav> </header> <div id="main">main</div> <footer>footer</footer>
/*一般設定===============================================*/ /*header===============================================*/ /*#logo=========*/ /*#nav=========*/ /*#social=========*/ /*#banner===============================================*/ #banner .more { text-align: right; padding: 10px; } #banner .more a { width: 60px; height: 40px; display: inline-block; color: #fff; font-size: 16px; line-height: 40px; text-align: center; border-radius: 5px; background: #4e342e; box-shadow: 1px 1px 3px #fff; } /*section1===============================================*/ /*section2===============================================*/ figcaption { color: #4e342e; font-size: 20px; text-align: center; font-weight: bold; } /*footer===============================================*/ footer{ background: #bdbdbd; height: 50px; box-shadow: 0 -1px 2px #000; }