Advertisement
MatthijsFontys

Grid generator

May 28th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.90 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <html lang="en" style="height: 100%;">
  4. <head>
  5.   <meta charset="utf-8">
  6.  
  7.   <title>The HTML5 Herald</title>
  8.   <meta name="description" content="The HTML5 Herald">
  9.   <meta name="author" content="SitePoint">
  10.   <link rel="stylesheet" href="css/styles.css?v=1.0">
  11.  <style>
  12. body{
  13.     line-height: 0;
  14. }
  15.  
  16. #grid-wrapper{
  17. padding: 0;
  18. width: 520px;
  19. margin: 0 auto;
  20. }
  21.  
  22. .box{
  23.     width: 50px;
  24.     height: 50px;
  25.     border: 2px solid black;
  26.     border-right: 2px solid black;
  27.     display:inline-block;
  28.     padding: 0;
  29.     margin: 0;
  30.     margin-right: -2px;
  31.     margin-bottom: -2px;
  32. }
  33.  </style>
  34. </head>
  35. <body style="height: 100%">
  36. <div id=grid-wrapper> </div>
  37. </body>
  38. </html>
  39.  
  40. <script type="text/javascript">
  41. let wrapper = document.querySelector("#grid-wrapper");
  42. for(let i=0; i< 100; i++){
  43.     let box = document.createElement("div");
  44.     box.classList.add("box");
  45.     wrapper.appendChild(box);
  46. }
  47. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement