After experimenting with the display and position style properties, I am struggling to move my element along the vertical axis. I borrowed CSS code from a button generator website and it works perfectly fine. Even added a JavaScript function to enhance its functionality but positioning remains a challenge for me.
#startButton {
box-shadow: 0px 0px 12px 2px #3dc21b;
background:linear-gradient(to bottom, #44c767 5%, #5cbf2a 100%);
background-color:#44c767;
border-radius:28px;
border:1px solid #18ab29;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Verdana;
font-size:18px;
padding:16px 31px;
text-decoration:none;
text-shadow:0px 1px 0px #2f6627;
position: relative;
top: 50%;
left: calc(50% - 30px);
}
.startButton:hover {
background:linear-gradient(to bottom, #5cbf2a 5%, #44c767 100%);
background-color:#5cbf2a;
}
.startButton:active {
position:relative;
top:1px;
}
The element is standalone in HTML, not residing within its own div, head, or body. Not sure if this matters, though. Any assistance would be greatly appreciated as I navigate through self-teaching coding with a current focus on JavaScript, acknowledging the importance of CSS and HTML in web development.
Edit: Realized that elements do not simply overlap as I initially assumed. Discovered that the 'space' allocated for the button element extends below the canvas. Looking for solutions on how to effectively layer these elements.