我想用HTML和CSS制作一个图像按钮。所以我尝试了background:url()
,但它不起作用。我还尝试了这些:
background: url(res/play.png)
background: url("res/play.png")
background: url("/res/play.png")
background: url(/res/play.png)
background-image: url(res/play.png)
它们都不起作用。这是我的目录结构。
MyProgram
└ res directory
└ style.css
└ index.html
这是我的代码。镜像位于res
目录中。
<table>
<tr>
<td>
<button id="previousButton"></button>
<button id="playButton"></button>
<button id="nextButton"></button>
</td>
<td>
<input type="range" id="volumeSlider" min="0" max="100" value="50" step="1">
<button id="muteButton"></button>
</td>
</tr>
</table>
button#playButton {
background: url(res/play.png);
}
https://stackoverflow.com/questions/56416051
复制相似问题