No fieldset padding top in IE8 |
No fieldset padding top in IE8 |
RainLover |
Nov 3 2012, 03:02 PM
Post
#1
|
Advanced Member Group: Members Posts: 216 Joined: 16-November 09 Member No.: 10,346 |
Sample form:
CODE <!DOCTYPE html> <html> <head> <title></title> <style> fieldset {padding: 15px;} </style> </head> <body> <form> <fieldset> <legend>Form</legend> <p> <label for="name">Name </label><input id="name" type="text"> </p> <p> <label for="email">Email </label><input id="email" type="text"> </p> </fieldset> </form> </body> </html> There's no padding top in IE8. Any cross-browser solution? |
Christian J |
Nov 3 2012, 04:03 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Try this CSS to see better what's going on:
CODE * {margin: 0; padding: 0;} form { background: pink; padding: 1em; } fieldset { border: 2px dashed #000; background: lime; padding: 15px; } legend { background: yellow; xdisplay: none; } p {background: fuchsia;} Seems to me there is a FIELDSET padding in IE8 As a workaround, try removing the FIELDSET top padding and increase the P top margin instead. This post has been edited by Christian J: Nov 3 2012, 10:56 PM |
RainLover |
Nov 3 2012, 09:20 PM
Post
#3
|
Advanced Member Group: Members Posts: 216 Joined: 16-November 09 Member No.: 10,346 |
|
pandy |
Nov 3 2012, 10:11 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
|
RainLover |
Nov 3 2012, 10:18 PM
Post
#5
|
Advanced Member Group: Members Posts: 216 Joined: 16-November 09 Member No.: 10,346 |
Could someone post a screen shot of how that looks in IE8/9? Before the workaround, that is. IE7 handles this in a crazy way. Does it help: http://dl.dropbox.com/u/4017788/Labs/screenshot3.jpg |
Christian J |
Nov 3 2012, 11:21 PM
Post
#6
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Could someone post a screen shot of how that looks in IE8/9? Before the workaround, that is. IE7 handles this in a crazy way. That's what I meant, it looks like the same in IE8. I thought IE9 looked the same, but I had forgotten one of these on my test page: CODE <meta http-equiv="X-UA-Compatible" content="IE=5"> (IE9 is also strange: if you don't use any BODY tags, you don't see any background or border on the FORM element, even if you specify it. There seem to be even worse complications, but let's not stare too deep into the abyss. ) |
pandy |
Nov 4 2012, 08:38 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
But the padding is much larger than what it's set to AND it shows up outside the border.
|
Christian J |
Nov 4 2012, 10:57 PM
Post
#8
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Yes.
And if you put a DIV around the FORM, and use no BODY tags, the DIV will clone itself into two in IE8. IE7 doesn't do that, instead the FORM background and border disappear. CODE <style type="text/css"> * {margin: 0; padding: 0;} div { border: 5px solid black; background: gray; margin: 1em; } form { border: 2px solid red; background: pink; padding: 1em; } fieldset { border: 2px dashed green; background: lime; padding: 15px; } legend {background: yellow;} p {background: fuchsia;} </style> <div> <form>beginning of form <fieldset> <legend>legend</legend> <p>paragraph</p> </fieldset> </form> end of div </div> |
pandy |
Nov 5 2012, 07:35 AM
Post
#9
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,732 Joined: 9-August 06 Member No.: 6 |
OH MY GOD! It's a frankenform!
Our shock smilie is sadly lacking. |
Lo-Fi Version | Time is now: 26th April 2024 - 08:46 PM |