你把图像放在
<button>
!
<<这就是问题所在
默认行为
<按钮(>);
是灰色的。
只需添加一个
inherit
价值到
background-color
css属性
https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
background-color: inherit;
图像很好!他们是
.png
所以他们很好
.footer-icon-list {
--height: 40px;
/* this is your background of the parent
I suggest you to change it (grey on black don't have a good contrast) */
background-color: #0f1720;
/* this shortcut set the bottom and top with the 10px */
padding: 10px 0;
/* centering */
display: flex;
text-align: center;
justify-content: space-evenly;
}
.footer-icon-list span button {
margin: auto;
border: none;
background-size: 40px;
height: 40px;
width: 40px;
/* the solution */
background-color: inherit;
}
/* images */
.Facebook-buttom {
background-image: url("https://raw.githubusercontent.com/AayushPokharel/ContentDeliveryRepo/master/facebook.png");
}
.Instagram-buttom {
background-image: url("https://raw.githubusercontent.com/AayushPokharel/ContentDeliveryRepo/master/instagram.png");
}
.Twitter-buttom {
background-image: url("https://raw.githubusercontent.com/AayushPokharel/ContentDeliveryRepo/master/twitter.png");
}
.Github-buttom {
background-image: url("https://raw.githubusercontent.com/AayushPokharel/ContentDeliveryRepo/master/github.png");
}
<div class="footer-icon-list">
<!-- 1 -->
<span><button class="Facebook-buttom"></button></span>
<!-- 2 -->
<span><button class="Instagram-buttom"></button></span>
<!-- 3 -->
<span><button class="Twitter-buttom"></button></span>
<!-- 4 -->
<span><button class="Github-buttom"></button></span>
</div>