Skip to content

Instantly share code, notes, and snippets.

@robertocarroll
Last active November 27, 2017 11:02
Show Gist options
  • Save robertocarroll/07a4de67164e391d9af9411db12597c4 to your computer and use it in GitHub Desktop.
Save robertocarroll/07a4de67164e391d9af9411db12597c4 to your computer and use it in GitHub Desktop.
WSAD CSS
shadow on box
.scroll-story-banner::after {
content: "";
position: absolute;
top: 100%;
left: 15px;
right: 15px;
width: auto;
height: 15px;
background: rgba(0,0,0,.2);
}
Text on link block
.link-block__text {
position: absolute;
left: 0;
bottom: 0;
right: 0;
margin: 0;
padding: 10px 15px;
background: rgba(0,0,0,0.6);
font-weight: bold;
}
Centre image inside a box
<div class="country__flag">
<div class="country__flag__inner">
<img src="https://images.worldskillsusercontent.org/ws13/ws66/11739/ws13663047-a57f-4f18-b4c5-3ed8052742c3_small" alt=""> </div>
</div>
.country__flag {
position: relative;
width: 100%;
margin-bottom: .5rem;
height: 0;
padding-bottom: 100%;
background: #ccc;
}
.country__flag__inner {
position: absolute;
top: 2em;
bottom: 2em;
left: 2em;
right: 2em;
width: auto;
height: auto;
display: flex;
align-items: center;
justify-content: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment