Skip to content

Instantly share code, notes, and snippets.

@cwlau
Last active November 7, 2015 10:25
Show Gist options
  • Save cwlau/7eed31d8dc3090ebb198 to your computer and use it in GitHub Desktop.
Save cwlau/7eed31d8dc3090ebb198 to your computer and use it in GitHub Desktop.
<!-- Demo from blog.cwlau.com -->
<html>
<style type="text/css">
.popup{
display: inline-block;
position: fixed;
top: 50%;
left: 50%;
width: 400px;
height: 120px;
margin-left: -200px;
margin-top: -60px;
z-index: 1;
/* Some styling CSS rules */
border: 1px solid #ff0000;
background-color: #fee;
}
</style>
<body>
<div class="popup">
This is a fixed popup dialog
<br/><br/>
Try resizing this window - This dialog always keeps its center position.
</div>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment