Do I need any of these codes on img2, and that they are useless, or do I keep any of them?
background-position:center;
When that is removed, it’s still centered, so I’m not sure how useful that code is.
background-repeat: no-repeat;
When I increase the background space, and put, background -repeat; repeat; nothing happens.
So, I’m not sure how useful that code is.
background-size: 180px 180px;
When I remove that from the code, nothing happens, so I’m not sure how useful that code is.
.img2 {
background-repeat: no-repeat;
background-position:center;
background-size: 180px 180px;
}
With them removed:
What do you say?
Also, is there a specific reason why these 2 style codes don’t function, or are disabled on img2?
background-repeat: no-repeat; or even repeat
background-position:center;
<style>
#playButton4 {
position: relative;
border: 3px solid #0059dd;
width: 260px;
height: 194px;
cursor: pointer;
background-color: black;
margin-top: 8px;
}
.img1 {
position:absolute;
background: url(https://i.imgur.com/BO6KOvw.jpg);
background-repeat: no-repeat;
background-position:center;
background-size: 170px 112px;
border-radius: 50%;
width: 170px;
height: 170px;
margin: 12px 45px;
}
.img2 {
position:absolute;
background: url(https://i.imgur.com/4HJbzEq.png);
background-repeat: no-repeat;
background-position:center;
background-size: 180px 180px;
width: 180px;
height: 180px;
margin: 7px 40px ;
}
#grad {
position: absolute;
top: 0;
left: 0;
width: 260px;
height: 194px;
background-color: transparent;
background-image: linear-gradient( to right, transparent 0, transparent 83px, #0059dd 83px, #0059dd 86px, transparent 86px, transparent 174px, #0059dd 174px, #0059dd 177px, transparent 177px, transparent 260px);
}
</style>
<div id="playButton4" onclick="">
<div class="img1"></div>
<div class="img2"></div>
<div id="grad"></div>