.box{ position: relative; display: inline-block; /* Make the width of box same as image */ } .container { width: 80%; } .box .text-centered{ position: absolute; z-index: 999; margin: 0 auto; font-weight: bolder; font-size: 30px; left: 0; right: 5%; top: 53%; /* Adjust this value to move the positioned div up and down */ text-align: center; width: 60%; %; /* Set the width of the positioned div */ } .drawn-button { background: url("../img/button.png") ; background-size: cover; background-repeat: no-repeat; text-align: center; font-size: 20px; font-weight: bolder; border: none; width: 300px; height: 130px; } .drawn-button:hover { background: url("../img/button_hover.png") ; background-size: cover; background-repeat: no-repeat; text-align: center; font-size: 20px; font-weight: bolder; border: none; } button::-moz-focus-inner { border: 0; } .fade-in { animation: fadeIn 2s; -webkit-animation: fadeIn 2s; -moz-animation: fadeIn 2s; -o-animation: fadeIn 2s; -ms-animation: fadeIn 2s; } .fade-in-var { animation: fadeIn var(--time); -webkit-animation: fadeIn var(--time); -moz-animation: fadeIn var(--time); -o-animation: fadeIn var(--time); -ms-animation: fadeIn var(--time); } .fade-out { animation: fadeOut 2s; -webkit-animation: fadeOut 2s; -moz-animation: fadeOut 2s; -o-animation: fadeOut 2s; -ms-animation: fadeOut 2s; } .handdrawn { border-top-left-radius: 255px 15px !important; border-top-right-radius: 15px 225px !important; border-bottom-right-radius: 225px 15px !important; border-bottom-left-radius:15px 255px !important; } .blur { -webkit-filter: blur(5px); -moz-filter: blur(5px); -o-filter: blur(5px); -ms-filter: blur(5px); filter: blur(5px); } @keyframes fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-moz-keyframes fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-webkit-keyframes fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-o-keyframes fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @-ms-keyframes fadeIn { 0% {opacity:0;} 100% {opacity:1;} } @keyframes fadeOut{ 100% {opacity:1;} 0% {opacity:0;} } @-moz-keyframes fadeOut { 100% {opacity:1;} 0% {opacity:0;} } @-webkit-keyframes fadeOut{ 100% {opacity:1;} 0% {opacity:0;} } @-o-keyframes fadeOut{ 100% {opacity:1;} 0% {opacity:0;} } @-ms-keyframes fadeOut{ 100% {opacity:1;} 0% {opacity:0;} }