Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. <div class="grid-container">
  2. <div class="item-1">1</div>
  3. <div class="item-2">2</div>
  4. <div class="item-3">3</div>
  5. <div class="item-4">4</div>
  6. </div>
  7.  
  8. .grid-container {
  9. display: grid;
  10. grid-template-columns: repeat(3,1fr);
  11. grid-gap: 20px;
  12. justify-items: center;
  13. }
  14.  
  15. .item-1 {
  16. background-color: rgba(200,520,266,.75);
  17. border-color: #b4b4b4;
  18. grid-column: 1;
  19. grid-row: 1;
  20. }
  21.  
  22. .item-2 {
  23. background-color: rgba(145,520,0,.75);
  24. grid-gap: 20px;
  25. }
  26.  
  27. .item-3 {
  28. background-color: rgba(145,520,0,.75);
  29. grid-column: 3;
  30. grid-row: 1;
  31. }
  32.  
  33. .item-4 {
  34. background-color: rgba(0,0,0,.25);
  35. border-color: transparent;
  36. grid-column: 2;
  37. grid-row: 2;
  38. }
  39.  
  40. .grid-container {
  41. display: -ms-grid;
  42. display: grid;
  43. -ms-grid-columns: 1fr 20px 1fr 20px 1fr;
  44. grid-template-columns: repeat(3,1fr);
  45. grid-gap: 20px;
  46. justify-items: center;
  47. }
  48.  
  49. .item-1 {
  50. background-color: rgba(200,520,266,.75);
  51. border-color: #b4b4b4;
  52. -ms-grid-column: 1;
  53. grid-column: 1;
  54. -ms-grid-row: 1;
  55. grid-row: 1;
  56. }
  57.  
  58. .item-2 {
  59. background-color: rgba(145,520,0,.75);
  60. grid-gap: 20px;
  61. }
  62.  
  63. .item-3 {
  64. background-color: rgba(145,520,0,.75);
  65. -ms-grid-column: 3;
  66. grid-column: 3;
  67. -ms-grid-row: 1;
  68. grid-row: 1;
  69. }
  70.  
  71. .item-4 {
  72. background-color: rgba(0,0,0,.25);
  73. border-color: transparent;
  74. -ms-grid-column: 2;
  75. grid-column: 2;
  76. -ms-grid-row: 2;
  77. grid-row: 2;
  78. }
  79.  
  80. .item2half {
  81. background-color: rgb(20,100,255);
  82. border-color: transparent;
  83. }
  84.  
  85. .grid-container {
  86. display: flex;
  87. justify-items: center;
  88. align-items: center;
  89. flex-wrap: wrap;
  90. }
  91.  
  92. .item-1 {
  93. flex: 1 1 33.33%;
  94. background-color: rgba(200,520,266,.75);
  95. border-color: #b4b4b4;
  96. }
  97.  
  98. .item-2 {
  99. flex: 1 1 33.33%;
  100. background-color: rgba(145,520,0,.75);
  101. }
  102.  
  103. .item-3 {
  104. flex: 1 1 33.33%;
  105. background-color: rgba(145,520,0,.75);
  106. }
  107.  
  108. .item-4 {
  109. flex-basis: 33.33%;
  110. /* important */
  111. margin: auto;
  112. background-color: rgba(0,0,0,.25);
  113. border-color: transparent;
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement