12

class="myButton"で定義し、CSS でスタイルを変更して、送信ボタンを画像に置き換えようとしています。クリックしても機能しmyButton:activeないようです。

これが私のCSSです:

.myButton{
    background:url(./images/but.png) no-repeat;
    cursor:pointer;
    border:none;
    width:100px;
    height:100px;
}

myButton:active {
     background:url(./images/but2.png) no-repeat;
}

HTML コード:

<input class="myButton" type="submit" value="">
4

2 に答える 2

30

このリンクを確認してください。.以前行方不明でしたmyButton。ちょっとしたミスでした。:)

.myButton{
    background:url(./images/but.png) no-repeat;
    cursor:pointer;
    border:none;
    width:100px;
    height:100px;
}

.myButton:active  /* use Dot here */
{   
    background:url(./images/but2.png) no-repeat;
}
于 2012-09-22T12:27:05.400 に答える