Solved

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

Posted on 2003-10-26
6
154 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: blockā€¦
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).

790 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