Last active
November 7, 2015 10:25
-
-
Save cwlau/7eed31d8dc3090ebb198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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