When working on a button element that already boasts a gradient effect, my aim was to integrate a small play image directly in the center. However, achieving this without compromising the current layout and ensuring compatibility across various browsers proved to be quite challenging.
#mcodebtn {
position: absolute;
width: 100%;
height: 100%;
background-image: url(http://s3.amazonaws.com/content.newsok.com/newsok/images/video-icon-play.png);
background-position: center;
background-repeat: no-repeat;
/* Include all browser-specific gradient properties */
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0px;
font-family: Arial;
text-decoration: none;
color: white;
}
.form1btn {
position: absolute;
left: 103px;
width: 100px;
height: 46px;
}
<div class="form1btn">
<input type="button" id="mcodebtn" value="">
</div>
The challenge lies in successfully aligning the play image at the center of the button while upholding the desired gradient background and maintaining browser prefix support.
If anyone has any innovative solutions or ideas to overcome this dilemma, feel free to share!