Method 1: The checkbox size can be set by using height and width property. According to HTML5 drafts, the checked attribute is a “ boolean attribute ”, and “The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.” It is the name of the attribute that matters, and suffices. There is no required value for the checked attribute. This property reflects the HTML checked attribute. The checked attribute value doesn't change with the state of the checkbox, whereas the … Otherwise only the last checked item in the group would be available upon submission. The height property sets the height of checkbox and width property sets the width of the checkbox. Place the id value of the checkbox into this attribute of the label. A checkbox is a small box which lets you choose multiple options. It only carries true and false value for the checked and unchecked item. That really helps you to design your checkbox CSS. Checkbox CSS Example #1. The HtmlHelper class includes two extension methods to generate a HTML control in a razor view: CheckBox () and CheckBoxFor (). Set the position to "relative". Checkbox CSS Example. The Html.CheckBox helper takes a string that is used to render the name and id attributes of the input element: @Html.CheckBox("IsChecked") There are overloads that enable you to set the checkbox as checked, and to provide additional arbitrary attributes: @Html.CheckBox("IsChecked", new { @class = "form-control" }) If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: var x = document.getElementById("myCheck").checked; document.getElementById("fname").value = document.getElementById("fname").value.toUpperCase(); W3Schools is optimized for learning and training. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. In its most simple form, a checkbox is simply an input element with the type property set to checkbox, like this: Tip: Always add the