Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Created October 24, 2017 06:22
Show Gist options
  • Save harisrozak/5a4001c4e8071f3f60200eca3148927c to your computer and use it in GitHub Desktop.
Save harisrozak/5a4001c4e8071f3f60200eca3148927c to your computer and use it in GitHub Desktop.
CSS position absolute center
.container {
width: 25%;
height: 50px;
position: relative;
}
.container .popup {
position: absolute;
width: 300px;
margin-left: 50%;
left: -150px;
bottom: 50px;
background-color: #d77c7c;
height: 100px;
}
.container .popup:after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #d77c7c transparent transparent transparent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment