---
title: "Comment by Jan Coenen on \"Styling a checkbox with only CSS\" | Hashnode"
description: "Hi Nathan, is this really the first comment on this excellent article? - I&#39;ve played a little arround with the code, introduced a class .cbx for the input c"
url: "https://hashnode.com/posts/styling-a-checkbox-with-only-css/60fec4eb1be2da0c4ab772a3/comment/6328a872195e7dc741da620d"
---

[Discussion](https://hashnode.com/posts/styling-a-checkbox-with-only-css/60fec4eb1be2da0c4ab772a3)

Comment [Styling a checkbox with only CSS](https://hashnode.com/posts/styling-a-checkbox-with-only-css/60fec4eb1be2da0c4ab772a3)

[Sep 19, 2022](https://hashnode.com/posts/styling-a-checkbox-with-only-css/60fec4eb1be2da0c4ab772a3/comment/6328a872195e7dc741da620d)

Hi Nathan, is this really the first comment on this excellent article? - I've played a little arround with the code, introduced a class .cbx for the input checkboxes and substituted label > input\[type="checkbox"\] in the styles with cbx. Works as expected so far, but now I want to eliminate the labels alltogether from the HTML. The whole thing doesn't work without labels and I don't understand why. They are not mentioned in my style section anymore.

[Nathan Kallman](https://hashnode.com/@kallmanation)

[Oct 4, 2022](https://hashnode.com/posts/styling-a-checkbox-with-only-css/60fec4eb1be2da0c4ab772a3/comment/6328a872195e7dc741da620d#reply-633c369512186eae2bef69e3)

Hi Jan, I tend to have a bit more traffic on [my cross-posts to dev.to](https://dev.to/kallmanation/styling-a-checkbox-with-only-css-3o3p) but it's great to have you here!

A `<label>` wrapping the input and the, well, _label_ for that input is the semantic, idiomatic way to structure your HTML; so I wouldn't recommend trying to remove it. But no matter what I would expect you to need something in the `<label>` 's place wrapping the two elements in order for sibling and psuedo selectors to work well and give you the styling options needed to make it all look nice.
