Is there a method to customize the appearance of a checkbox or radio button solely using CSS, such as with the class "newstyle," without relying on jQuery? I've been exploring various resources online and I'm curious if there is a solution that can be accomplished solely through the use of the "class" attribute. Take a look at this example:
EDIT: This is my current approach:
<div class="styled-checkbox">
<input type="checkbox" id="checkbox1" value="1" />
<label for="checkbox1"><span></span>Test</label>
</div>
However, I am uncertain if this is the optimal way to achieve the desired result, especially in terms of compatibility. Additionally, the default behavior seems to require a predefined width for the div element; otherwise, it may expand to fill the entire document.