Check out my HTML & CSS code. I'm facing an issue with the top padding, which should be 20px but is currently set at 10px. Here's a screenshot showing the problem.
I've attempted to adjust margins and padding on different elements, but nothing seems to resolve the issue. Can anyone identify the cause of this problem and suggest a solution?
@import 'https://fonts.googleapis.com/css?family=Roboto:300,900'; /* font-family: 'Roboto', sans-serif; */
html, body { margin: 0; padding: 0; font-family: 'Roboto', sans-serif; background: #ffffff; }
img { width: 100%; display: block; }
.block { color: #fff; font-size: 18px; background: #444444; text-align: center; padding: 10px 0px; } /* padding inside col */
* { margin: 0; padding: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
.wrap { width: 75%; margin: 0 auto; background: transparent; padding: 10px;} /* padding surrounding grid */
.grid { width: 100%; }
.grid:after { clear: both; content: ""; display: table; }
.row { padding: 0px 0; background: transparent; }
.col-1-4 { width: 25%; }
.col-1-2 { width: 50%; }
.col-3-4 { width: 75%; }
.col-1-1 { width: 100%; }
.col-1-5 { width: 20%; }
[class*='col'] { float: left; padding: 10px; } // padding between cols & rows
.gallery-grid { margin: 0; padding: 0; list-style: none; position: relative; width: 100%; }
.gallery-grid li { position: relative; float: left; overflow: hidden; width: 16.6666667%; width: -webkit-calc(100% / 6); width: calc(100% / 6); }
@media (max-width: 768px) { [class*='grid'] { width: 100%; } [class*='col'] { width: 100%; padding: 10px 20px;} }
@media (max-width: 768px) { .gallery-grid li { width: 33.3333333%; width: -webkit-calc(100% / 3); width: calc(100% / 3); } }
<!DOCTYPE html>
<html lang="en-US">
<head>
<title></title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" type="text/css" href="styles/siimple.css">
</head>
<body>
<div class="row">
<div class="wrap">
<div class="grid">
<div class="col-1-4"><div class="block">1-4</div></div>
<div class="col-1-4"><div class="block">1-4</div></div>
<div class="col-1-4"><div class="block">1-4</div></div>
<div class="col-1-4"><div class="block">1-4</div></div>
<div class="col-1-2"><div class="block">1-2</div></div>
<div class="col-1-2"><div class="block">1-2</div></div>
</div>
</div>
</div>
<div class="row">
<ul class="gallery-grid">
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
<li><a href="#"><img src="http://placehold.it/800x800"></a></li>
</ul>
</div>
<div class="row">
<div class="wrap">
<div class="grid">
<div class="col-1-1"><div class="block">1-1</div></div>
<div class="col-1-5"><div class="block">1-5</div></div>
<div class="col-1-5"><div class="block">1-5</div></div>
<div class="col-1-5"><div class="block">1-5</div></div>
<div class="col-1-5"><div class="block">1-5</div></div>
<div class="col-1-5"><div class="block">1-5</div></div>
</div>
</div>
</div>
</body>
</html>