Home  >  Article  >  Web Front-end  >  How to set checkbox size in css

How to set checkbox size in css

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-25 17:42:1110983browse

In CSS, you can use the width attribute and height attribute to set the size of the checkbox. You only need to set the "height: value" and "width: value" styles for the checkbox element. The width attribute defines the width of the check box, and the height attribute defines the height of the check box.

How to set checkbox size in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>document</title>
    <style>
      input[type="checkbox"] {
        margin-right: 10px;
        cursor: pointer;
        width: 30px;
        height: 30px;
        position: relative;
      }
    </style>
  </head>
  <body bgcolor="bisque">
    <div class="check-item">
      <input type="checkbox" class="check-item-in" id="checkbox3" />正常复选框
      <label for="checkbox3"></label>
    </div>
  </body>
</html>

The effect is as shown:

How to set checkbox size in css

Recommended learning: css video tutorial

The above is the detailed content of How to set checkbox size in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn