SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy IE: margin/padding in fieldsets incorrect

    Hello,

    I have a problem with fieldsets in IE. It is treating padding-top like margin-top. That means when I say padding:20px and margin-top:20px then I have:

    - margin-top:40px
    - padding-top:0px
    - padding-right:20px
    - padding-bottom:20px
    - padding-left:20px

    Thatīs very annoying because Iīm using fieldsets very often. Is there any way to fix it? I donīt want do add extra HTML and it would be nice if I donīt have to edit all the CSS of the first elements in the fieldsets. I mean I could add margin-top:20px to the first <input> or whatever. But there must be a smarter way.

    oerdec

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Hmmm I don't know about IE treating padding-top like margin-top, it sounds to me like collapsing margins..

    Can you provide an example piece of code that displays the issue - Chances are when you strip down your example, you'll find the problem.
    Or post a link to a page that displays the issue.

    Cheers,

  3. #3
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here&#180;s an example.

    I don&#180;t have set any margins. But if you see it in IE and FF you'll see the difference. BTW. the red border is the border of the form.

    oerdec

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Don't know

    However, a fix that you are probably already aware of and looking for a cleaner solution would be to have a div within your fieldset and apply the padding to that..
    Sorry i'm not more help.

  5. #5
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you anyway. The extra <div> is not an option. I think I'll add margin-top to all the first elements in the fieldsets. Then I have to remove the unnecessary margins between fieldsets. Maybe it works with negative margins.

  6. #6
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I finally solved the problem. It was caused by the legends and not by fieldsets. Hereīs the result for anyone whoīs interested.

    oerdec


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
  •