Search code examples
cssprintingstylesheetprinting-web-page

How to hide all buttons in IE6 without hiding all inputs in a printing stylesheet?


Whats the easiest method of hiding all buttons but not all inputs (say drop down lists, text input boxes) in CSS that works with IE6. The purpose of this CSS file is for printing (using the media="Print" tag in the HTML).


Solution

  • Since IE6 doesn't support input[type="button"] syntax, the easiest thing to do is have each button use class="button" and add a .button { display: none; } to the print CSS.

    Another option is to use the <button> tag (but I'm not sure that's standard in newer (X)HTML)