Page 1 of 1

CSS Tag to hide Form Buttons for print mode

Posted: Wed Mar 28, 2007 7:42 pm
by sindelar
:cry: Work-a-round: using css tag to hide HTML4.01 (FORM "buttons") in print mode. Validates with Tidy Message Warning against embedding "p", "span", and other tags I've tried.

Posted: Thu Mar 29, 2007 12:21 am
by MikeGale
If you post details of your source (markup and CSS) plus the message you should get better feedback.

Posted: Thu Mar 29, 2007 1:01 am
by sindelar
Hi Mike,

<center><span class="noprint"><form action="button"><input type="button" value=" BACK " onclick="history.go(-1)"><input type="button" value="Main Menu" onclick="parent.location='Menu.html'"><input type="button" value="MENU" onclick="parent.location='LC.html'"><input type="button" value="TOP" onclick="parent.location='#Top'"><input type="button" value="FORWARD" onclick="history.go(1)"></form></span></center>

Thanks
Bob

Posted: Thu Mar 29, 2007 10:14 am
by Albert Wiersch
Hi Bob,

You can enclose block-level elements in "div" elements but not "span" elements. "form" is a block-level element. I think this is the problem. Please see:
http://www.w3.org/TR/html401/struct/glo ... l#edef-DIV
The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. These elements define content to be inline (SPAN) or block-level (DIV) but impose no other presentational idioms on the content. Thus, authors may use these elements in conjunction with style sheets, the lang attribute, etc., to tailor HTML to their own needs and tastes.

Posted: Thu Mar 29, 2007 12:04 pm
by sindelar
Thanks Albert,

The code change to <div> worked great!

Bob