programming arts…

Tip: Internet Explorer DIV Height Problem

Yes i know, i’m for GWT, Ext, Dojo, Zk, and all the other frameworks that made life easy to web developers abstracting the HTML/CSS and most part of the Js layers, but I come from hard and deep JS/DHTML/CSS hand-programming (HttpXMLRequest sweet HttpXMLRequest) then somethimes i help my collegues to solve classic HTML/Js problems…

One of this is the Interent Explorer buggy way of manage div heights: Any height less than 20px is rendered as 20px.

I just give to you some techniques to hack this annoying IE bug:

1) Put a comment inside an empty div:

<div style="height: 10px;"><!-- --></div>

2) Put a &nbsp;  inside the div and add this to its style: font-size:1px;
line-height:0.

<div style="font-size: 1px; line-height: 0pt;">&nbsp;</div>

of course the styling rules can be put in a css class…

Refs:

http://archivist.incutio.com/viewlist/css-discuss/39150

http://www.codingforums.com/showthread.php?t=46408

Reblog this post [with Zemanta]
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • Diggita
  • DZone
  • HackerNews
  • LinkedIn
  • PDF
  • Ping.fm
  • Reddit
  • RSS
  • Segnalo
  • Technorati
  • Tumblr
  • Twitter
  • Wikio
  • SphereIt
  • Suggest to Techmeme via Twitter

Tags: , , , , , ,

No Comments

rssComments RSS transmitTrackBack Identifier URI

No comments. Be the first.

addLeave a comment





Spam protection by WP Captcha-Free