Advertisement
raphael76280

Untitled

Jul 27th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.88 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title></title>
  5.     <style type="text/css">
  6.         * {
  7.             margin: 0px;
  8.             padding: 0px;
  9.         }
  10.  
  11.         body {
  12.             width: 100vw;
  13.             height: 100vh;
  14.             background-color: rgb(202, 219, 239);
  15.         }
  16.  
  17.         .header {
  18.             background-color: rgb(162, 225, 207);
  19.             box-shadow: 0px 2px 2px 2px #84b3a5;
  20.         }
  21.  
  22.         .header h1 {
  23.             text-decoration: underline;
  24.             color: white;
  25.         }
  26.  
  27.         .main {
  28.             width: 70vw;
  29.             padding: 5vw;
  30.             margin: auto;
  31.             margin-top: 1vh;
  32.             background-color: rgb(206, 255, 241);
  33.             height: 70vh;
  34.             box-shadow: 2px 2px 2px 2px #84b3a5;
  35.             display: flex;
  36.             flex-direction: column;
  37.             justify-content: space-around;
  38.         }
  39.  
  40.         .modal {
  41.             position: absolute;
  42.             padding: 5vw;
  43.             top:20vh;
  44.             left: 50vw;
  45.             transform: translateX(-50%);
  46.             margin: auto;
  47.             background-color: rgb(241, 255, 206);
  48.             height: 50vh;
  49.             width: 50vw;
  50.             box-shadow: 2px 2px 2px 2px #84b3a5;
  51.             display: flex;
  52.             flex-direction: column;
  53.             justify-content: space-around;
  54.         }
  55.  
  56.         .modal button {
  57.             transform: translate(-5vw, -5vw);
  58.             background-color: red;
  59.             border-color: darkred;
  60.             font-size: 1em;
  61.             width: 1.5em;
  62.             height: 1.5em;
  63.         }
  64.     </style>
  65. </head>
  66. <body>
  67.     <div class="header">
  68.         <h1>Mon Site</h1>
  69.     </div>
  70.     <div class="main">
  71.         <h1>Ma page principale</h1>
  72.         <p> Teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeext </p>
  73.  
  74.         <button onclick="toggleModal('modalJeux')">Mes jeux</button>
  75.     </div>
  76.    
  77.  
  78.     <div id="modalJeux" class="modal" style="display: none;">
  79.         <button onclick="toggleModal('modalJeux')">X</button>
  80.         <h1>Ma page de jeux</h1>
  81.         <p>Texxxxxxxxxxxxxxxxxxt</p>
  82.     </div>
  83.  
  84.     <script type="text/javascript">
  85.         function toggleModal(id) {
  86.             element = document.getElementById(id);
  87.             if (element.style.display == "none"){
  88.                 element.style.display = "block";
  89.             }else{
  90.                 element.style.display = "none";
  91.             }
  92.         }
  93.     </script>
  94.  
  95. </body>
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement