index.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Fancy Border Box</title>
  6. <style>
  7. @charset "UTF-8";
  8. @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. border: 0;
  13. box-sizing: border-box;
  14. }
  15. *:before, *:after {
  16. box-sizing: border-box;
  17. }
  18. html, body {
  19. height: 100%;
  20. background: radial-gradient(#003, #000);
  21. overflow: hidden;
  22. color: #fff;
  23. font-family: "Open Sans";
  24. font-size: 18px;
  25. }
  26. h1 {
  27. font-weight: 700;
  28. margin-bottom: 0.5em;
  29. }
  30. .box {
  31. position: absolute;
  32. top: 50%;
  33. left: 50%;
  34. transform: translate3d(-50%, -50%, 0);
  35. background-color: rgba(0, 0, 0, 0.5);
  36. width: 100%;
  37. max-width: 600px;
  38. padding: 5px;
  39. border: 2px solid #b78846;
  40. }
  41. .box:before, .box:after {
  42. content: "•";
  43. position: absolute;
  44. width: 14px;
  45. height: 14px;
  46. font-size: 14px;
  47. color: #b78846;
  48. border: 2px solid #b78846;
  49. line-height: 12px;
  50. top: 5px;
  51. text-align: center;
  52. }
  53. .box:before {
  54. left: 5px;
  55. }
  56. .box:after {
  57. right: 5px;
  58. }
  59. .box .box-inner {
  60. position: relative;
  61. border: 2px solid #b78846;
  62. padding: 40px;
  63. }
  64. .box .box-inner:before, .box .box-inner:after {
  65. content: "•";
  66. position: absolute;
  67. width: 14px;
  68. height: 14px;
  69. font-size: 14px;
  70. color: #b78846;
  71. border: 2px solid #b78846;
  72. line-height: 12px;
  73. bottom: -2px;
  74. text-align: center;
  75. }
  76. .box .box-inner:before {
  77. left: -2px;
  78. }
  79. .box .box-inner:after {
  80. right: -2px;
  81. }
  82. </style>
  83. </head>
  84. <body>
  85. <div class="box">
  86. <div class="box-inner">
  87. <h1>Lorem Ipsum</h1>
  88. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum laudantium odit, eligendi architecto eveniet labore error minus, temporibus doloremque, amet itaque. Voluptatum rerum dolorem nesciunt totam. Saepe reprehenderit dignissimos error!</p>
  89. </div>
  90. </div>
  91. <script>
  92. // https://codepen.io/MyXoToD/pen/VaazQq
  93. </script>
  94. </body>
  95. </html>