How can I remove an extra line break or spacing?

Discussion in 'HTML & Website Design' started by Rahul Bose, Jun 29, 2010.

  1. #1
    Ok, I have the following code. I want the form fields with the Submit button nicely tucked in the table row with bgcolor. However, whgen I view it in Firefox or IE8, I get extra space under the form fields (see screenshot). How can I remove that extra space. I tried Including the form in div tags and stuff but no luck.

    echo("
    <br><br>
    <table align='center' cellpadding='0' cellspacing='0' width='780' valign='top'>
    <tr>
    <td bgcolor='#cccccc' align='right'>
    <form method='post' action='test.php'>
    <input type='text' size='15' name='searchtext'>
    <select name='cat'>
    <option value='1'>Test1</option>
    <option value='2'>Test2</option>
    <option value='3'>Test3</option>
    </select>
    <input type='submit' value=Submit>&nbsp;
    </form>

    </td>
    </tr>
    </table>
    ");
     
    Rahul Bose, Jun 29, 2010 IP
    tintumon likes this.
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,927
    Likes Received:
    4,563
    Best Answers:
    124
    Trophy Points:
    665
    #2
    You've got a space after the submit button but are you talking about a gap between the drop down and the submit button?

    No screenshot, btw :)
     
    sarahk, Jun 29, 2010 IP
  3. hes

    hes Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think the form element has a default margin-bottom or padding-bottom depending on the browser... try giving it a style of margin-bottom: 0 and padding-bottom: 0.
     
    hes, Jun 30, 2010 IP
  4. Forbidd3n

    Forbidd3n Well-Known Member

    Messages:
    262
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Yeah, you need to do it in a style or inline like this on the form tag...

    <form style="margin:0;padding:0;">
     
    Forbidd3n, Jun 30, 2010 IP
  5. ayekaye01

    ayekaye01 Peon

    Messages:
    214
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    check your css
     
    ayekaye01, Jul 1, 2010 IP