SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    misbehaving form tags?

    Im having trouble with a form for a search box in my nav bar, it looks fine in dreamweaver but when it is displayed in a browser it re-sizes the height of the row that it is in, i have tried almost everything but still cant figure out why it is happening, I have noticed though that if I take the form tags out it displays correctly, is there any way of constaining a form? any ideas?

    the page can be seen here:

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's because form fields are block level. You can either set margin:0; padding:0 on the field, or make it inline with display:inline;. I think those work but I usually have to fidget a little to get stuff working and I could be feeding you bunk.
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tried the margin="0" padding="0" but to no avail, how does the display:inline; work?

    Cheers

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I'm pretty sure the input fields are inline by default, but the <form> tag itself has margin/padding that most probably varies between browsers.

    Here's how to set the margin and padding to 0 through css:

    html: (give that form an id)
    Code:
    <form id="search">
    .... field here
    </form>
    css:
    Code:
    #search {
    margin: 0;
    padding: 0;
    }

  5. #5
    SitePoint Member
    Join Date
    Jul 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Spot on! thanks, worked a treat!


Bookmarks

Posting Permissions

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