Skip to content

Instantly share code, notes, and snippets.

@NdYAG
Last active January 3, 2016 16:09
Show Gist options
  • Select an option

  • Save NdYAG/8487662 to your computer and use it in GitHub Desktop.

Select an option

Save NdYAG/8487662 to your computer and use it in GitHub Desktop.
A Pen by Captain Anonymous.
<!--
CSS Daily Practice
Level: Simple
Description: A translucent bubble with box-shadow surround all bubble shape
Defact: Text in bubble got opacity
-->
<div class="bubble">
Lorem Ipsum
</div>
@import "compass";
html, body {
height: 100%;
}
body {
background: url(http://img5.douban.com/view/photo/large/public/p2005080697.jpg) no-repeat center;
background-size: cover;
}
.bubble {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
padding: 1em;
color: #fff;
opacity: .6;
box-shadow: 0 0 5px cyan;
z-index: 0;
&:before {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
background: #000;
}
&:after {
content: "";
background: #000;
position: absolute;
top: -.4em;
left: 1em;
width: 1em;
height: 1em;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
box-shadow: 0 0 5px cyan;
z-index: -2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment