CSS Tag to hide Form Buttons for print mode

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
Post Reply
sindelar
Rank 0 - Newcomer
Posts: 7
Joined: Wed Mar 28, 2007 11:08 am
Location: New York
Contact:

CSS Tag to hide Form Buttons for print mode

Post 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.
What can we do individually to regain Liberty & Justice?
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

If you post details of your source (markup and CSS) plus the message you should get better feedback.
sindelar
Rank 0 - Newcomer
Posts: 7
Joined: Wed Mar 28, 2007 11:08 am
Location: New York
Contact:

Post 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
Last edited by sindelar on Thu Mar 29, 2007 12:02 pm, edited 1 time in total.
User avatar
Albert Wiersch
Site Admin
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post 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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
sindelar
Rank 0 - Newcomer
Posts: 7
Joined: Wed Mar 28, 2007 11:08 am
Location: New York
Contact:

Post by sindelar »

Thanks Albert,

The code change to <div> worked great!

Bob
What can we do individually to regain Liberty & Justice?
Post Reply