Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

Re: HTML Help

Question posted by: Stevo (Guest) on June 27th, 2008 07:19 PM
SirCodesALot wrote:
Quote:
Hi All, I know this is a javascript group, but this where the great
minds are, so I figured I would ask here.
>
Can anyone explain to me why the blue column in this code is
vertically higher than the rest? In Firefox, all is fine. Just in IE
do i see the extra a space.
>
<table cellspacing="0" cellpadding="1"><tr><td height="120px"><div
style="height:95px;"></div><div style="height:20px;">5</div><div
style="background-color:red;height:5px;"></div></td><td
height="120px"><div style="height:0px"></div><div style="height:
20px;">100</div><div style="background-color:green;height:100px;"></
div></td><td height="120px"><div style="height:20px;"></div><div
style="height:20px;">80</div><div style="background-color:blue;height:
80px;"></div></td></tr></table>
>
thanks in advance,
-Scott


1. The 5px high red div needs overflow:hidden in the style.
2. You'll need to remove the 0px high div in the green section. IE seems
to have a problem with 0px high DIVs. Even setting overflow:hidden on
them doesn't seem to work. If you set it to 1px high it'll be fine.
Weird huh, a 0px high div is taller than a 1px high div :-)

Here's a working version:

<table cellspacing="0" cellpadding="1">
<tr height="120">
<td>
<div style="height:95px;"></div>
<div style="height:20px;">5</div>
<div style="background-color:red;height:5px;overflow:hidden;"></div>
</td>
<td>
<!-- div style="height:0px"></div -->
<div style="height:20px;">100</div>
<div style="background-color:green;height:100px;"></div>
</td>
<td>
<div style="height:20px;"></div>
<div style="height:20px;">80</div>
<div style="background-color:blue;height:80px;"></div>
</td>
</tr>
</table>
Martin's Avatar
Martin
Guest
n/a Posts
June 27th, 2008
07:19 PM
#2

Re: Re: HTML Help
Quote:
Weird huh, a 0px high div is taller than a 1px high div :-)
>


Maybe IE considers 0px size to be infinite?

Martin.


SirCodesALot's Avatar
SirCodesALot
Guest
n/a Posts
June 27th, 2008
07:19 PM
#3

Re: Re: HTML Help
On Jun 6, 2:20*am, Martin <warwo...@gmail.comwrote:
Quote:
Quote:
Weird huh, a 0px high div is taller than a 1px high div :-)

>
Maybe IE considers 0px size to be infinite?
>
Martin.


Thank you all for the replies, and again, sorry for the incorrect
group posting, but alas, I knew I came to the right place :)

thanks again.

 
Not the answer you were looking for? Post your question . . .
189,170 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors