html { overflow-y: scroll; } body { font-family: sans-serif; margin: 0; /* padding: 40px; */ } .itemo { float: left; position: relative; line-height: 1em; } .grid-sizer { width: 20%; } .itemo { width: 20%; /* padding-left: 5px; */ /* padding-right: 5px; */ /* padding-top: 5px; */ /* padding-bottom: 5px; */ /* border-right: 15px solid; */} @media screen and (max-width: 1224px) { /* 10 columns for larger screens */ .grid-sizer { width: 33.33%; } .itemo { width: 33.33%; } } @media screen and (max-width: 720px) { /* 10 columns for larger screens */ .grid-sizer { width: 50%; } .itemo { width: 50%; } } @media screen and (max-width: 480px) { /* 10 columns for larger screens */ .grid-sizer { width: 100%; } .itemo { width: 100%; } } .image{ max-width: 100%; margin: 0; display: block; /* padding: 5px 5px 5px 5px; */ /* border: 15px solid; */ } .image:after { clear:both; } .overlay { width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); position: absolute; top: 0; left: 0; text-decoration: none; color: #fff; display: none; } .overlay .title { text-align: center; font-size: 30px; } .overlay .description { position: absolute; bottom: 0; left: 0; background-color: rgba(0,0,0,0.80); width: 100%; margin: 0; } .overlay .description p { margin: 20px; } .itemo:hover .overlay { display: block; }