Demo by Ryan Seddon Tabbed Areas. CODEPEN. The element also has an enabled state, in which it can be activated or accept focus. Do realize though that the user can modify this if they know what they are doing. Checkboxes that use the JavaScript component do not need this class; a disabled attribute on the < input > element is sufficient. But instead of checkboxes, in which any checkbox can be on or off independently of one another, these tabs use radio buttons in which only one per group can be on at a time (like how only one tab can be active at a time). In order to style the checkbox the user first need to hide the default checkbox which can be done by setting the value of the visibility property to hidden. So keep that in mind. Add the input's id as the value of the for attribute of the label. Why would you use a disabled checkbox in the first place? Note that mdc-checkbox--disabled is necessary on the root element of CSS-only checkboxes to prevent hover states from activating. Even though styling a checkbox using modern CSS features is currently possible, using SVG to create custom checkboxes remains, in my opinion, the most flexible, powerful, and accessible way. it's works like a charm.. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. Hide the default checkbox using css rules like visibility:hidden or opacity:0 or position:absolute;left:-9999px etc. Then, a JavaScript could remove the disabled value, and make the element usable. C – Draw our custom square checkbox. a checkbox in the user's browser. Refer this link for more info. In English, this line means “show a star symbol when the checkbox/radio is checked”. Use CSS’s :disabled selector (for CSS3): checkbox-style { } checkbox-style:disabled { } Or you need to use javascript to alter the style based on when you enable/disable it (Assuming it is being enabled/disabled based on your question). I always use pseudo elements :before and :after for changing the appearance of checkboxes and radio buttons. D – Just a couple more cosmetics. input[type=checkbox]:disabled:after { display: block; content: ""; background: green; opacity: .8; height: 12px; width: 12px; } You can see a demo here But what's making a disabled checkbox gray? or accept focus. Will leave a link below to an entire list of available HTML symbols. Put the disabled attribute on the checkboxes. The :disabled CSS pseudo-class represents any disabled element. If you want to change the style of disabled checkbox then you can try with the below code. The for attribute is necessary to bind our custom checkbox with the input. Steps. Besides, the check mark character is not present in several commonly used fonts. The font size, show a pointer on mouse hover, change the background color. A disabled input element is unusable and un-clickable. Example 1: Consider the example where HTML checkbox is styled using CSS. Can you avoid it by CSS? An element is disabled if it can't be activated (selected, clicked on, typed into, etc.) HTML & CSS. mikey_w. It's basically useful only in the case of a page where the content is changed via client-side scripting, so that a checkbox can be disabled or normal Using SVG, we don’t style the checkbox itself — we hide the checkbox and use an SVG to create a checkbox image. The dirname attribute can be set to keep a user from using the element until some other condition has been met (like selecting a checkbox, etc.). Use checkboxes when looking for yes or no answers. The “tabs” design pattern is just toggling on and off of areas, perfect for the checkbox hack.