When structuring my website, I often find myself in situations where I want to style identical elements differently based on their intended use. For example, I may have checkboxes that are styled using the Checkbox Hack technique and others that are traditional form checkboxes. How can I write CSS to distinguish between these different types of elements?
Currently, I have the Checkbox Hack checkboxes hidden from view with the following CSS:
input[type=checkbox] {
position: absolute;
top: -9999px;
left: -9999px;
}
However, this method also hides my "real" checkboxes, which is not ideal. As someone who learned CSS in a piecemeal manner, I lack knowledge of the standard practices for handling this common issue. Can anyone offer guidance on the best approach to tackle this challenge?