Currently, I am new to HTML and still in the process of learning. I am facing a challenge in centering a button within a div, and I have been using margins to position it. While this method works well when the window is fullscreen, the button's position gets affected when the window size is reduced.
[Apologies for any imperfections in my English xD]
Below is the CSS code for the button:
.signupbutton {
position: relative;
margin-left: 880px;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0d8f64), color-stop(1, #0d8f64));
background: -moz-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -webkit-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -o-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -ms-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: linear-gradient(to bottom, #0d8f64 5%, #0d8f64 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0d8f64', endColorstr='#0d8f64', GradientType=0);
background-color: #0d8f64;
-moz-border-radius: 14px;
-webkit-border-radius: 14px;
border-radius: 14px;
border: 2px solid #424745;
display: inline-block;
color: #ffffff;
font-family: arial;
font-size: 16px;
font-weight: bold;
padding: 12px 42px;
text-decoration: none;
text-shadow: 0px -1px 0px #5b6178;
}
.signupbutton:hover {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0d8f64), color-stop(1, #0d8f64));
background: -moz-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -webkit-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -o-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: -ms-linear-gradient(top, #0d8f64 5%, #0d8f64 100%);
background: linear-gradient(to bottom, #0d8f64 5%, #0d8f64 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0d8f64', endColorstr='#0d8f64', GradientType=0);
background-color: #0d8f64;
}
.signupbutton:active {
position: relative;
top: 1px;
}