我正在尝试通过 CSS 更改图像的颜色。图片是我网站布局的一个元素。 这是显示元素的屏幕截图:https://screenshots.firefox.com/xLCsVyZtSKLxFi9F/gameshunt.pl这是一个带有表格的示例帖子 - https://gameshunt.pl/promocje-na-gogu-2-05/
它的代码是这样的:
table.tablesorter thead tr th {
background-image: url(/wp-content/plugins/table-sorter/images/bg.gif);
cursor: pointer;
background-repeat: no-repeat;
background-position: right center;
}
我尝试了 background-image: #fff, background image: #fff, url (wp-content/etc)
但没有任何效果。有谁知道如何更改此元素的颜色?我不能只上传不同的文件,因为颜色只需要在深色模式下不同。
最佳答案
您可以尝试使用 CSS 制作箭头:
div {
background: grey;
padding: 5px;
}
.sort:before {
content: "";
display: block;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid black;
}
.sort:after {
content: "";
display: block;
width: 0;
height: 0;
margin-top: 3px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 5px solid black;
}
.white:before {
border-bottom: 5px solid white;
}
.white:after {
border-top: 5px solid white;
}
<div class="sort"></div>
<div class="sort white"></div>
关于css - 如何通过CSS改变背景图片的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55955407/