Skip to content

Instantly share code, notes, and snippets.

@gmcusaro
Created November 30, 2022 14:29
Show Gist options
  • Save gmcusaro/0d41ffbdfda84a80c05400c233d49f18 to your computer and use it in GitHub Desktop.
Save gmcusaro/0d41ffbdfda84a80c05400c233d49f18 to your computer and use it in GitHub Desktop.
Full width content section
<html>
<head>
<style>
body {
--mainBG: #000;
margin: 0;
padding: 0;
}
section {
padding: 1em;
}
section:first-of-type {
background-color: var(--mainBG);
color: #fff;
}
.container {
width: min(calc(80% - 2rem), 60rem);
margin-inline: auto;
}
.inverse {
background-color: var(--mainBG);
color: #fff;
}
.fully-inverse {
box-shadow: 0 0 0 100vmax var(--mainBG);
clip-path: inset(0 -100vmax);
}
</style>
</head>
<body>
<div class= "container">
<section>
<h1>title</h1>
</section>
<section class="inverse fully-inverse">
<h1>title</h1>
</section>
<section>
<h1>title</h1>
</section>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment