LoginSignup
13
12

More than 5 years have passed since last update.

ラジオボタン・チェックボックスの大きさをCSSで変更する方法

Last updated at Posted at 2015-11-10

背景

スマホやタブレットで見ると、デフォルトのラジオボタンやチェックボックスって小さくて使い辛いですよね。そこで、ラジオボタンとチェックボックスの大きさを変更したいものの、jQueryとか画像とかは使いたくない。
ということで、CSSのみで変更する方法を試してみました。

方法

transform:scale()を使うことで出来るようになります。
(下記の例では1.5倍の大きさにしています)

responsive.css
input[type="radio"] , input[type="checkbox"]{
   -webkit-transform: scale(1.5);
   transform: scale(1.5);
   margin-right: 0.5em;

注意

transform:scale()はCSS3ですので、古いブラウザでは対応してません。

13
12
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
13
12