Advertisement
powys

element appear on hover menu with instructions! cr appreciated (@ciarispop) <3

Jul 6th, 2021
5,293
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None
  1. <!-- scrollbox appear on hover effect made by dante~! cr appreciated @ciarispop pls dont repost on other pastebins tt__tt -->
  2.  
  3.  
  4. <style>
  5.  
  6. #cont { /*container! i'd recommed u only change the border eheh */
  7. width: 300px;
  8. height: 300px;
  9. border: 4px double black;
  10. border-radius: 12px;
  11. position: relative;
  12. margin-left: auto;
  13. margin-right: auto;
  14. }
  15.  
  16. .imgbg { /* image made to fit no matter the size! */
  17. width: 100%;
  18. height: 100%;
  19. object-fit: cover;
  20. border-radius: 9px; /*for an image to fit make it -3px than the border-radius of the #cont*/
  21. }
  22.  
  23. #float { /* floating text, u can change this! */
  24. position: absolute;
  25. width: 100%;
  26. left: 0;
  27. top: 100px;
  28. text-align: center;
  29. z-index: 1;
  30. text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000, 0 0;
  31. font-style: italic;
  32. font-family: times;
  33. font-size:2em;
  34. font-weight:bold;
  35. color: #fff;
  36. animation-name: floating;
  37. animation-duration: 3s;
  38. animation-iteration-count: infinite;
  39. animation-timing-function: ease-in-out;
  40. }
  41.  
  42. @keyframes floating {
  43. 0% { transform: translate(0, 0px); }
  44. 50% { transform: translate(0, 15px); }
  45. 100% { transform: translate(0, -0px); }
  46. }
  47.  
  48.  
  49. #scroll {
  50. /* scrollbox! u can change this! note: mess around with the 'margin-left' depending on the width or if u change anything of the scrollbox bc it messes a bit */
  51. opacity: 0;
  52. position: absolute;
  53. margin-left: 4%;
  54. width: 250px;
  55. top: 140px;
  56. border: 1px solid black;
  57. border-radius: 10px;
  58. padding: 10px;
  59. height: 110px;
  60. overflow: scroll;
  61. background: #FFFFFF90;
  62. transition: opacity .35s ease;
  63. /* style of the text inside scrollbox */
  64. font-size: 14px;
  65. font-family: times;
  66. color: #000;
  67. text-align: center;
  68. }
  69.  
  70. #cont:hover #scroll {
  71. opacity: 1;
  72.  
  73. }
  74.  
  75.  
  76. #overlay { /* overlay! (blue in this case) (hidden without mouseover) */
  77. position: absolute;
  78. bottom: 0;
  79. left: 0;
  80. right: 0;
  81. background: rgba(199, 234, 252, 0); /*copy the color of ur choice in rgb! the last digit stands for opacity*/
  82. overflow: hidden;
  83. width: 0;
  84. height: 100%;
  85. transition: background 0.5s ease;
  86. border-radius: 9px;
  87.  
  88. }
  89.  
  90. #cont:hover #overlay { /* overlay when hovered! (it appears) */
  91. width: 100%;
  92. background: rgba(199, 234, 252, .2); /*copy the color of ur choice in rgb! the last digit stands for opacity*/
  93. transition: background 0.5s ease-out;
  94. }
  95.  
  96.  
  97. </style>
  98.  
  99. <div id="cont">
  100.  
  101.  
  102. <img class=imgbg src="https://i.imgur.com/3zXYDZg.png">
  103. <div id="float"> title </div>
  104. <div id="overlay"> </div>
  105. <div id="scroll"> your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here your text goes here </div>
  106. </div>
Advertisement
RAW Paste Data Copied
Advertisement