Advertisement
makispaiktis

Codecademy - 17th Exercise (Responsive Websites - CSS)

Oct 24th, 2019 (edited)
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.92 KB | None | 0 0
  1. html,
  2. body {
  3.   font-family: Helvetica, sans-serif;
  4.   font-size: 16px;
  5.   margin: 0;
  6.   background-color: white;
  7. }
  8.  
  9. .container {
  10.   max-width: 960px;
  11.   margin: 0 auto;
  12. }
  13.  
  14. .main {
  15.   height: 30rem;
  16.   padding-top: 1rem;
  17.   background-image: url("https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-5/tsunami-coffee/images/bg-photo.png");
  18.   background-repeat: no-repeat;
  19.   background-position: center;
  20.   background-size: cover;
  21. }
  22.  
  23. .main img {
  24.   width: 15rem;
  25.   display: block;
  26.   margin: auto;
  27.   margin-top: 5rem;
  28. }
  29.  
  30. nav {
  31.   background-color: OrangeRed;
  32.   color: White;
  33. }
  34.  
  35. ul {
  36.   list-style: none;
  37.   margin: 0;
  38. }
  39.  
  40. li {
  41.   display: inline-block;
  42.   padding: 0.75rem 1.25rem;
  43. }
  44.  
  45. .supporting,
  46. .rating,
  47. .gallery,
  48. .location {
  49.   margin: 4em auto;
  50. }
  51.  
  52. .supporting {
  53.   display: flex;
  54.   align-items: flex-start;
  55.   padding: 0 1rem;
  56. }
  57.  
  58. .supporting img {
  59.   height: 10%;
  60.   width: 10%;
  61.   margin-right: 5%;
  62. }
  63.  
  64. .rating {
  65.   background-color: OrangeRed;
  66.   height: 20rem;
  67.   padding: 0 1rem;
  68.   color: white;
  69.   display: flex;
  70.   justify-content: center;
  71.   align-items: center;
  72. }
  73.  
  74. .rating h1 {
  75.   font-size: 2.5rem;
  76. }
  77.  
  78. .gallery img {
  79.   display: block;
  80.   width: 30%;
  81.   margin: 1.5%;
  82.   float: left;
  83. }
  84.  
  85. .clearfix {
  86.   clear: both;
  87. }
  88.  
  89. .location {
  90.   text-align: center;
  91.   margin-bottom: 7rem;
  92. }
  93.  
  94. .location img {
  95.   width: 100%;
  96.   height: auto;
  97. }
  98.  
  99. footer {
  100.   background-color: OrangeRed;
  101.   padding: 0 1rem;
  102. }
  103.  
  104. footer .container {
  105.   display: flex;
  106.   align-items: center;
  107.   justify-content: space-between;
  108.   padding: 5em 0;
  109.   color: white;
  110. }
  111.  
  112. @media only screen and (max-width: 960px){
  113.   .main{
  114.     padding-top: 0;
  115.   }
  116. }
  117.  
  118. @media only screen and (max-width: 700px){
  119.   .supporting img{
  120.     display: none;
  121.   }
  122. }
  123.  
  124. @media only screen and (max-width: 470px){
  125.   .rating h1{
  126.     font-size: 2rem;
  127.   }
  128.   .gallery img{
  129.     margin: 0;
  130.   }
  131.   footer nav{
  132.     display: none;
  133.   }
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement