Advertisement
asimryu

반응형웹연습(20150910) -1

Sep 9th, 2015
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.54 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>반응형웹-  Responsive Web</title>
  6. <style>
  7.     body { background-color: black; margin: 0;}
  8.     #wrap {
  9.         margin: 0 auto;
  10.         width: 1024px;
  11.         min-height: 768px;
  12.         background-color: white;
  13.     }
  14.     header {
  15.         width: 1024px;
  16.         height: 300px;
  17.         background-image: url(http://lorempixel.com/1024/300);
  18.     }
  19.     nav { width: 100%; background-color: red;}
  20.     nav a {
  21.         width: auto;
  22.         height: 50px;
  23.         padding: 0 10px;
  24.         background-color: pink;
  25.         color: black;
  26.         line-height: 50px;
  27.         display: inline-block;
  28.     }
  29.     #viewmenu {display: none;}
  30.     @media screen and (max-width:768px){
  31.         #wrap { width: 768px; }
  32.         header {
  33.             width: 768px;
  34.             height: 200px;
  35.             background-image: url(http://lorempixel.com/768/200);
  36.         }
  37.     }
  38.     @media screen and (max-width:320px){
  39.         #wrap { width: 320px; }
  40.         header {
  41.             width: 320px;
  42.             height: 80px;
  43.             background-image: url(http://lorempixel.com/320/80);
  44.         }
  45.         nav a {
  46.             width:100%;
  47.             height: 30px;
  48.             line-height: 30px;
  49.             border-bottom: 1px solid white;
  50.         }
  51.         #viewmenu {display: inline-block;}
  52.         .menu { display: none;}
  53.         #viewmenu:focus ~ .menu{
  54.             display: inline-block;
  55.         }
  56.     }
  57. </style>
  58. </head>
  59. <body>
  60. <div id="wrap">
  61. <header></header>
  62. <nav>
  63.     <a href="#" id="viewmenu">MENU...</a>
  64.     <a href="#" class="menu">HOME</a>
  65.     <a href="#" class="menu">HTML</a>
  66.     <a href="#" class="menu">CSSS</a>
  67.     <a href="#" class="menu">JavaScript</a>
  68.     <a href="#" class="menu">PHP</a>
  69.     <a href="#" class="menu">Database</a>
  70. </nav>
  71. </div>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement