jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes My divs are being shrunk to 0 width Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "My divs are being shrunk to 0 width" Watch "My divs are being shrunk to 0 width" New topic
Author

My divs are being shrunk to 0 width

Tony Ennis
Ranch Hand

Joined: May 22, 2003
Posts: 86
I have divs styled to be a certain width.



The contents of the divs are filled by a program. Sometimes these divs have no content. IE7 displays
them as I want - an 'empty' section of space of the specified width. IE8 and FF ignore the width, however,
and render the divs as 0px wide.

What do I do to force the empty divs to be displayed at the specified width?

If I put an   in the empty divs, they are rendered the way I want, but this is hokey.


Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

If I put an   in the empty divs, they are rendered the way I want, but this is hokey.


This is the only way.


GenRocket - Experts at Building Test Data
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

You can set a min-height of the div, that way IE8 and FF will render them...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My divs are being shrunk to 0 width