0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

マウスホバー時にボタンを大きくする

Posted at

LPやHPが寂しい時にボタンを大きくするって考えがちですよね。
それの良し悪しは置いといて、マウスホバー時にCSSでボタンを大きくする方法を見ていきましょう。

CSSでボタンを大きくする

まずはボタンのHTMLです。

index.html
<button class="btn">ボタン</button>

次にcssです。

styel.css
.btn{
    /*btnを大きくする処理*/
    transition: all 0.3s ease;
    /*btnのcss*/
    width: 200px;
    height: 60px;
    background: aqua;
    color: black;
    border: none;
}
.btn:hover{
    /*btnを大きくする処理*/
    transform: scale(1.15,1.15);
    /*btnのcss*/
    cursor: pointer;
}

以上がマウスホバー時にボタンを大きくする方法です。

ブラウザによってはスタイルが当たらない場合があるので、その際はブラウザごとに必要なwebkitなどの処理を追加してください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?