CSS "classitis" for a printing issue

October 27, 2005 / Filed under: CSS

As a temporary solution to a small printing problem that some clients (on another site) were facing, I’ve started to apply a generic class of noprint to any element that I wish to "hide" from the printer, which is included in the print style sheet:

.noprint
{
    display: none;
}

This is handy, because I can simply apply it to any element:

<ul class="noprint">
    <li>...</li>
    <li>...</li>
</ul>

However, I’m not sure I like slapping in classes - left and right. I wouldn’t want to come down with a case of classitis.

Until a better solution can be figured out, this will have to do.

Comments/Mentions