So, I can create an input button with an image using
(所以,我可以创建一个带图像的输入按钮)
<INPUT type="image" src="/images/Btn.PNG" value="">
But, I can't get the same behavior using CSS.
(但是,我无法使用CSS获得相同的行为。)
For instance, I've tried (例如,我试过了)
<INPUT type="image" class="myButton" value="">
where "myButton" is defined in the CSS file as
(其中“myButton”在CSS文件中定义为)
.myButton {
background:url(/images/Btn.PNG) no-repeat;
cursor:pointer;
width: 200px;
height: 100px;
border: none;
}
If that's all I wanted to do, I could use the original style, but I want to change the button's appearance on hover (using a myButton:hover
class).
(如果这就是我想做的,我可以使用原始样式,但我想在悬停时更改按钮的外观(使用myButton:hover
类)。)
I know the links are good, because I've been able to load them for a background image for other parts of the page (just as a check). (我知道链接很好,因为我已经能够为页面的其他部分加载它们作为背景图像(就像检查一样)。)
I found examples on the web of how to do it using JavaScript, but I'm looking for a CSS solution. (我在网上找到了如何使用JavaScript进行操作的示例,但我正在寻找一个CSS解决方案。)
I'm using Firefox 3.0.3 if that makes a difference.
(如果这有所不同,我正在使用Firefox 3.0.3。)
ask by Baltimark translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…