確認テスト(2)
解答(記述実践)
確認テスト(2)記述実践 - jsdo.it - share JavaScript, HTML5 and CSS
↓ブラウザで確認する
確認テスト(2)
HTML
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen,print"> <title>確認テスト(2)</title> </head> <body> <!-- ▼#container --> <div id="container"> <!-- ▼#header --> <div id="header"></div> <!-- ▲#header --> <!-- ▼#nav --> <div id="nav"> <ul> <li id="nav1"><a href="#"></a></li> <li id="nav2"><a href="#"></a></li> <li id="nav3"><a href="#"></a></li> <li id="nav4"><a href="#"></a></li> <li id="nav5"><a href="#"></a></li> </ul> </div> <!-- ▲#nav --> <!-- ▼#wrapper --> <div id="wrapper"> <!-- ▼#content --> <div id="content"></div> <!-- ▲#content --> <!-- ▼#sidebar --> <div id="sidebar"></div> <!-- ▲#sidebar --> </div> <!-- ▲#wrapper --> <!-- ▼#footer --> <div id="footer"></div> <!-- ▲#footer --> </div> <!-- ▲#container --> </body> </html>
CSS
@charset "UTF-8"; /* reset */ * { margin: 0; padding: 0; } body { background-color: #ccc; } #container { width: 800px; height: 600px; margin: 0 auto; background-color: #fff; } #header { width: auto; height: 120px; background-color: #a3bed5; } /* nav */ #nav { width: 800px; height: 60px; } #nav ul{ list-style-type: none; } #nav li{ float: left; width: 160px; height: 60px; } #nav li a { display: block; width: 160px; height: 60px; } #nav1 a:link{ background-color: #fffacd; } #nav2 a:link{ background-color: #f0e68c; } #nav3 a:link{ background-color: #deb887; } #nav4 a:link{ background-color: #f4a460; } #nav5 a:link{ background-color: #bdb76b; } #nav li a:hover { background-color: #99cc00; } #wrapper { width: 800px; height: auto; overflow :hidden; } #content { float: right; width: 600px; height: 400px; background-color: #dcd78a; } #sidebar { float: left; width: 200px; height: 400px; background-color: #9cc56e; } #footer { clear: both; height: 60px; background-color: #e0b9d2; }
解答(応用)
確認テスト(2)応用 - jsdo.it - share JavaScript, HTML5 and CSS
↓ブラウザで確認する
確認テスト(2)応用
CSS
@charset "UTF-8"; /* reset */ * { margin: 0; padding: 0; } body { background-color: #ccc; } #container { width: 800px; height: 640px; margin: 0 auto; background-color: #fff; padding: 10px 10px 0; } #header { width: auto; height: 120px; background-color: #a3bed5; } /* nav */ #nav { width: 800px; height: 60px; margin: 10px 0 10px; } #nav ul{ list-style-type: none; } #nav li{ float: left; width: 160px; height: 60px; } #nav li a { display: block; width: 160px; height: 60px; } #nav1 a:link{ background-color: #fffacd; } #nav2 a:link{ background-color: #f0e68c; } #nav3 a:link{ background-color: #deb887; } #nav4 a:link{ background-color: #f4a460; } #nav5 a:link{ background-color: #bdb76b; } #nav li a:hover { background-color: #99cc00; } #wrapper { width: 800px; height: auto; overflow :hidden; } #content { float: right; width: 595px; height: 360px; background-color: #dcd78a; margin-bottom: 10px; } #sidebar { float: left; width: 195px; height: 360px; background-color: #9cc56e; } #footer { clear: both; height: 60px; background-color: #e0b9d2; }