Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  5. <style>
  6. * {
  7. box-sizing:border-box;
  8. }
  9. .header {
  10. background-color:#2196F3;
  11. float:left;
  12. width:100%;
  13. }
  14.  
  15. .menu {
  16. background-color:blue;
  17. float:left;
  18. width:25%;
  19. }
  20.  
  21. .topic {
  22. background-color:#f1f1f1;
  23. float:left;
  24. width:50%;
  25. }
  26.  
  27. .ad {
  28. background-color:#4CAF50;
  29. float:left;
  30. width:25%;
  31. }
  32.  
  33. .content {
  34. background-color:yellow;
  35. float:left;
  36. width:75%;
  37. }
  38.  
  39. .footer {
  40. background-color:brown;
  41. float:left;
  42. width:80%; /* The width is 100%, when the viewport is 800px or smaller */
  43. margin-left:10%;
  44. margin-right:10%;
  45. }
  46.  
  47.  
  48.  
  49. /* Use a media query to add a break point at 800px: */
  50. @media screen and (max-width:900px) {
  51. .header {
  52. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  53. }
  54. .menu {
  55. width:25%; /* The width is 100%, when the viewport is 800px or smaller */
  56. }
  57. .topic {
  58. width:75%; /* The width is 100%, when the viewport is 800px or smaller */
  59. }
  60. .ad {
  61. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  62. }
  63. .content {
  64. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  65. }
  66. .footer {
  67. width:80%; /* The width is 100%, when the viewport is 800px or smaller */
  68. margin-left:10%;
  69. margin-right:10%;
  70. }
  71.  
  72. }
  73.  
  74. /* Use a media query to add a break point at 800px: */
  75. @media screen and (max-width:600px) {
  76. .header {
  77. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  78. }
  79. .menu {
  80. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  81. }
  82. .topic {
  83. width:50%; /* The width is 100%, when the viewport is 800px or smaller */
  84. }
  85. .ad {
  86. width:50%; /* The width is 100%, when the viewport is 800px or smaller */
  87. }
  88. .content {
  89. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  90. }
  91. .ad.ad1 {
  92. width:100%; /* The width is 100%, when the viewport is 800px or smaller */
  93. }
  94. .footer {
  95. width:80%; /* The width is 100%, when the viewport is 800px or smaller */
  96. margin-left:10%;
  97. margin-right:10%;
  98. }
  99.  
  100. }
  101. </style>
  102. </head>
  103. <body>
  104.  
  105. <h2>Pirma uzduotis</h2>
  106.  
  107.  
  108. <div class="header">
  109. <p>Header</p>
  110. </div>
  111.  
  112. <div class="menu">
  113. <p>Menu</p>
  114. </div>
  115.  
  116. <div class="topic">
  117. <p>Topic</p>
  118. </div>
  119.  
  120. <div class="ad">
  121. <p>Ad</p>
  122. </div>
  123.  
  124. <div class="content">
  125. <p>Content</p>
  126. </div>
  127.  
  128. <div class="ad ad1">
  129. <p>Ad</p>
  130. </div>
  131.  
  132. <div class="footer">
  133. <p>Footer</p>
  134. </div>
  135.  
  136. </body>
  137. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement