IE formating html erratically (sp?)

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi,

I'm having an issue with formating html over IE ... don't know if there is a simple solution for that, so here I go ...

You can copy-paste the code attached to an html file, like "test.html". There is no harmfull code there, just some simple text layout.

When you open the file using IE (in my case IE 6), you'll see a blank line after the text "Form Contents" (or more likely, the table that contains it).

If you delete the starting tag line <form ...> and the end tag line </form>, the blank line just disappears as expected.

So as a conclusion, the form tag is adding a blank line, which it shouldn't do in the first place. This problem does NOT occur using FireFox ...

Does anyone have a solution to the problem? As I see it, the form tag should be an outputless tag ... but in IE seems not beeing so ...

I'm currently testing some solutions that my imagination generates ...


Thank you.
 

joinT

Lifer
Jan 19, 2001
11,172
0
0
try this.. it doesn't necessarily matter exactly where the form tag is.. it's been a while since i used this hack, so bear with me..
 

joinT

Lifer
Jan 19, 2001
11,172
0
0
if that doesn't work, move the form tag outside the table tag.. i can't remember off the top of my head which removes the form caused whitespace

 

joinT

Lifer
Jan 19, 2001
11,172
0
0
ps. might need to move the close form tag too.. put it symmetrical to the open tag (ie. outside close table tag if outside the open table tag works)
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
There's nothing wrong with your HTML. What I usually do is to do a global CSS reset:

* { padding: 0; margin: 0; }

and then add the bottom margin for the elements that needs it:

p, h1...h6, form, dl, dd ...... { margin-bottom: 1em; }

This will generally make it look the same across almost all browsers (including IE, Opera and Firefox)

Edit: A much more simpler way is just to set this:

form { margin-bottom: 0; }
 

joinT

Lifer
Jan 19, 2001
11,172
0
0
Originally posted by: screw3d
There's nothing wrong with your HTML.

well we already knew that (see title ;) )

used to use the above hack back in '98-99 :eek:

i never realized CSS could affect forms.. that's bomb. :thumbsup:

 

Eureka

Diamond Member
Sep 6, 2005
3,822
1
81
Wel, congratualations. CSS is the universal style.

If it doesn't work in IE, that's not the coder's fault. It's IE's fault for using its own wacko way of rendering pages.

Norm
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Thank you for the solutions! I was thinking this could be a pain to solve ... not so, thankfully! eheh

Thank you.
 

joinT

Lifer
Jan 19, 2001
11,172
0
0
Originally posted by: cevilgenius
If it doesn't work in IE, that's not the coder's fault. It's IE's fault for using its own wacko way of rendering pages.

again.. well aware.. but you have to cater to your audience..
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: joinT
Originally posted by: cevilgenius
If it doesn't work in IE, that's not the coder's fault. It's IE's fault for using its own wacko way of rendering pages.

again.. well aware.. but you have to cater to your audience..

Painfully true! :(