Skip to content

Instantly share code, notes, and snippets.

@SBaof
Last active September 14, 2017 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SBaof/10aa53c5d1006a10cc6fec43fc3f9f60 to your computer and use it in GitHub Desktop.
Save SBaof/10aa53c5d1006a10cc6fec43fc3f9f60 to your computer and use it in GitHub Desktop.
Translucent borders
/**
* Translucent borders
*/
body {
background: url('http://csssecrets.io/images/stone-art.jpg');
}
div {
border: 10px solid hsla(0,0%,100%,.5);
background: url('http://via.placeholder.com/500x500') no-repeat;
background-size: cover;
background-clip: padding-box;
/* styling */
max-width: 20em;
padding: 2em;
margin: 2em auto 0;
font: 100%/1.5 sans-serif;
}
<div>
Can I haz semi-transparent borders?
Pretty please?
</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment