Results 1 to 5 of 5
  1. #1

    HTML <form> tag always does a break

    I have a standard <form blah blah> </form> tag, but it always breaks (<br />) after it. This is throwing off my design quite a bit. Is there anyway to do a <form> tag so it doesn't do a <br /> afterwards?

    Thx
    TextAdMarket - http://www.TextAdMarket.com
    Supply & Demand Advertising

  2. #2
    Join Date
    Nov 2001
    Location
    Vancouver
    Posts
    2,422
    Surely you don't actually mean that there's a BR element being inserted after your form, right? Are you just refering to the placement of whatever element (lets assume a P following) having space above? Use CSS.

    Assuming your next element is a P...

    form + p {margin-top:0;}
    “Even those who arrange and design shrubberies are under
    considerable economic stress at this period in history.”

  3. #3
    Well, here is what it looks like:

    Code:
    <th align="center" scope="col" width="33%" height="34">
    <form method="post" action="rating.php">
         <select name="rating">
                    <option>100%</option>
                    <option>95%</option>
                    <option>90%</option>
                    <option>85%</option>
                    <option>80%</option>
                    <option>75%</option>
                    <option>70%</option>
                    <option>65%</option>
                    <option>60%</option>
                    <option>55%</option>
                    <option>50%</option>
                    <option>45%</option>
                    <option>40%</option>
                    <option>35%</option>
                    <option>30%</option>
                    <option>25%</option>
                    <option>20%</option>
                    <option>15%</option>
                    <option>10%</option>
                    <option>5%</option>
                    <option>0%</option>
         </select>
         <input type="submit" name="Search3" value="Rate" />
    </form>
    </th>
    How can I clean this up with CSS so it doesn't print a line break after the </form> close?
    TextAdMarket - http://www.TextAdMarket.com
    Supply & Demand Advertising

  4. #4
    Join Date
    Nov 2001
    Location
    Vancouver
    Posts
    2,422
    Here's an example:
    HTML Code:
    <html>
    <style type="text/css">
        form#rating {margin-bottom:0;}
    </style> 
    <body>
    <table>
    <tr>
    <th align="center" scope="col" width="33%">
    <form id="rating" method="post" action="rating.php">
         <select name="rating">
                    <option>100%</option>
                    <option>95%</option>
            <!-- snip -->
                    <option>5%</option>
                    <option>0%</option>
         </select>
         <input type="submit" name="Search3" value="Rate" />
    </form>
    </th>
    </tr>
    <tr><td>Hoo Ha</td></tr>
    </table>
    </body>
    </html>
    Your mileage may vary. If you run into inconsistencies among browsers, ecommend using a valid DOCTYPE.
    “Even those who arrange and design shrubberies are under
    considerable economic stress at this period in history.”

  5. #5
    Thanks mwatkins! That worked great!
    TextAdMarket - http://www.TextAdMarket.com
    Supply & Demand Advertising

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •