Solved

How to remove line above and below of <FORM>...</FORM>

Posted on 2003-10-26
6
152 Views
Last Modified: 2010-04-09
I do not want the empty line above and below the Search TextField as shown by following code. How to remove them.
 
<HTML>
<BODY LEFTMARGIN=0 TOPMARGIN=0>

<TABLE align=center bgColor=#CCCCEE WIDTH=100%>
  <TR>
    <TD align=right vAlign=center width="50%">
      <B>MY COMPANY LOGO<B>
      <FORM name=SearchForm METHOD=POST>
          <INPUT maxLength=200 name=SEARCH_TEXT>
          <INPUT name=Search type=submit value=Search>
      </FORM>
    </TD>
  </TR>
</TABLE>

</BODY>
</HTML>
0
Comment
Question by:javaq092999
  • 3
  • 2
6 Comments
 

Author Comment

by:javaq092999
ID: 9625179
Answering Myself (javaq):

Use following...

<HEAD>
<STYLE TYPE="text/css">
    FORM {margin-top: 0; margin-bottom: 0;}
</STYLE>
</HEAD>
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 50 total points
ID: 9626455
Just so you know, you can also do this:

<STYLE TYPE="text/css">
<!--
    FORM { display: inline; }
//-->
</STYLE>


or this:

<STYLE TYPE="text/css">
<!--
    FORM { margin: 0px; }
//-->
</STYLE>
0
 
LVL 1

Expert Comment

by:tlp560
ID: 9636455
Just move the <FORM tag out off the table, no CSS involved, like this .:

<FORM name=SearchForm METHOD=POST>
<TABLE align=center bgColor=#CCCCEE WIDTH=100%>
  <TR>
    <TD align=right vAlign=center width="50%">
      <B>MY COMPANY LOGO<B>
          <INPUT maxLength=200 name=SEARCH_TEXT>
          <INPUT name=Search type=submit value=Search>
     </TD>
  </TR>
</TABLE>
</FORM>
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 31

Expert Comment

by:seanpowell
ID: 9636533
That will remove the space inside the table - but it still creates the extra padding below the form - so if you have the following - you won't be able to get the 2 tables to be adjacent.

<FORM name=SearchForm METHOD=POST>
<TABLE align=center bgColor=#CCCCEE WIDTH=100%>
  <TR>
    <TD align=right vAlign=center width="50%">
      <B>MY COMPANY LOGO<B>
          <INPUT maxLength=200 name=SEARCH_TEXT>
          <INPUT name=Search type=submit value=Search>
     </TD>
  </TR>
</TABLE>
</FORM>
<TABLE align=center bgColor=#ff0000 WIDTH=100%>
  <TR>
    <TD align=right vAlign=center width="50%">More text here...</TD>
  </TR>
</TABLE>

That's why I prefer to set the form properties in the stylesheet - it simply removes the problem alltogether!
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9640512
Thanks javaq - and thanks for the A :-)
0
 

Author Comment

by:javaq092999
ID: 9641344
Though I answered myself but thought of acknowleding your (georgemarian) correct response. Thanks.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question