views:

72

answers:

2

Hi guys,

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).

+2  A: 

You can apply a class to all button inputs.

  <input type="submit" class="hidethis".../>

Then create a css class in the print stylesheet to hide those.

  .hidethis{
     display:none;
  }
Vincent Ramdhanie
+1  A: 

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)

Matt
`<button>` is fine, it would just need to be `<button type="button">` for IE, which incorrectly defaults to `<button type="submit">`.
bobince
@bobince thanks I never knew that.
Matt