#box{ width: 600px; overflow: hidden; background: pink; box-shadow: 0 0 10px black; border-radius: 10px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; padding: 10px; text-align: center; display: none; } #box span{ color: hotpink; font-size: 40px; display: block; margin: 20px 0; } #box h1{ color: brown } .close{ font-size: 15px; color: white; padding: 10px 20px; cursor: pointer; background: rgb(111, 111, 223); display: inline-block; border-radius: 1px solid #000; }