Advertisement
b0rn-to-be-wild

Tutorial: POP-UP BOXES (v.2) CSS

Mar 3rd, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Paste the following code under <style type="text/css">:
  2.  
  3. /*----- POP UP BOX by borntobewildcodes -----*/
  4.  
  5. /* You can change the placement of this box and set position value to fixed */
  6.  
  7. #popup_button{
  8. position:fixed;
  9. margin-top:50px;
  10. margin-left:50px;
  11. width:30px;
  12. height:30px;
  13. padding:5px;
  14. background:#fff;
  15. border:1px solid #eee;
  16. border-radius:2px;
  17. text-align:center;
  18. line-height:30px;
  19. overflow:hidden;
  20. z-index:10000;
  21. -webkit-transition: all 0.7s ease;
  22. -moz-transition: all 0.7s ease;
  23. -o-transition: all 0.7s ease;
  24. }
  25.  
  26. #popup_button span{
  27. font-size:12px;
  28. color:#444;
  29. }
  30.  
  31. #popup_button:hover span{
  32. color:#000;
  33. }
  34.  
  35. #open{
  36. position:absolute;
  37. width:30px;
  38. height:30px;
  39. }
  40.  
  41. #close{
  42. position:absolute;
  43. width:30px;
  44. height:30px;
  45. z-index:10;
  46. display:none;
  47. }
  48.  
  49.  
  50. /* Pop-up box */
  51.  
  52. #popup_box{
  53. position:fixed;
  54. top:50%;
  55. left:50%;
  56. padding:30px 40px;
  57. width:520px;
  58. height:auto;
  59. background:#ffffff;
  60. border:1px solid #eee;
  61. z-index:10000;
  62. overflow:hidden;
  63. display:none;
  64. color:#222222;
  65. font-size:15px;
  66. line-height:25px;
  67. text-align:justify;
  68. -webkit-transition: all 0.7s ease;
  69. -moz-transition: all 0.7s ease;
  70. -o-transition: all 0.7s ease;
  71. -webkit-transform:translateX(-50%) translateY(-50%);
  72. -moz-transform:translateX(-50%) translateY(-50%);
  73. -ms-transform:translateX(-50%) translateY(-50%);
  74. -o-transform:translateX(-50%) translateY(-50%);
  75. transform:translateX(-50%) translateY(-50%);
  76. }
  77.  
  78. #shadow{
  79. position:fixed;
  80. top:0px;
  81. left:0px;
  82. width:100%;
  83. height:100%;
  84. z-index:1000;
  85. background:rgba(0,0,0,0.7);
  86. display:none;
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement