Skip to content

Instantly share code, notes, and snippets.

@Ashkanph
Created April 15, 2019 12:57
Show Gist options
  • Save Ashkanph/1582189ec0fb5e20f66683287060a23d to your computer and use it in GitHub Desktop.
Save Ashkanph/1582189ec0fb5e20f66683287060a23d to your computer and use it in GitHub Desktop.
responsive grid area which hide one of its items
<!DOCTYPE html>
<html>
<head>
<style>
.subscribe-section {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
background-color: #2196F3;
padding: 10px;
}
.subscribe-section > div {
background-color: rgba(255, 255, 255, 0.8);
text-align: center;
padding: 20px 0;
font-size: 30px;
}
@media only screen and (max-width: 993px) {
.subscribe-section {
grid-template-columns: 1fr;
}
.subscribe-section__picto{ display: none; }
}
</style>
</head>
<body>
<h1>Grid Layout</h1>
<p>This grid layout contains six columns and three rows:</p>
<div class="subscribe-section">
<div class="subscribe-section__form">Form</div>
<div class="subscribe-section__picto">Picto</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment