views:

157

answers:

4

i have this this simple div :

<div id="error_message">Some bad things happened here, sorry... try again later!</div>

and this css:

#error_message
{
     width:170px;
     height:44px;
     color:green;
     font-size:15px;
     margin-left:10px;
     text-align:center;
}

ok, as i expected ie6 kicks my butt again :D so what it does is to actually "cut" my text and it displays just "sorry... try again later!" i google it without any satisfying result. Do you have any antidote for this?

A: 

Try not setting a height. you don't need it anyway.

Robusto
not working....
kmunky
Try making the div very wide ... say, width:300px ... and see if the rest of the text shows up.
Robusto
A: 

put the text inside <p> </p>
if it doesn't work try removing the comma or the width

another thing you should check too is the margin if the container of that div has the same width as his child well then maybe ie is pushing the margin left above the div (hiding the beginning of the sentence)

try this in order:

  • add <p> </p> inside the div
  • remove the comma
  • remove the width
  • remove the margin
  • trigger haslayout
  • display:inline on the div
Knu
A paragraph is just a block element like a div. There's no meaningful difference.
Tom
@Tom, true in general but there may be here, depending on the CSS the OP isn't sharing.
D_N
@Tom the difference is how the content is treated... instead of having to use display:inline, he just needs to use <p> // and im not asking to replace the div but to add the paragraph inside // like i said if it doesn't solve it, the culprits are probably the comma or the width
Knu
Tom
A: 

Isn't the width the problem? 15px is fairly big font size and 170px isn't a lot of room. Try increasing the width (or just removing it). First set 'width: 100%;' to see if that is the problem, then start cutting it back until it fits.

Tom
@Tom, it works just fine in any other browser...
kmunky
A: 

This sounds like the infamous IE6 disappearing text bug.

http://www.google.com/search?q=ie6+disappearing+text

Historically, the fix is to style a parent div of your problem div with position:relative. If it works, you're in luck.

What causes the problem in the first place? One guy says:

This effect may turn up in a number of different contexts. We would try to list them here, but the page would become very long, and make our heads hurt.

-- http://www.positioniseverything.net/explorer/peekaboo.html

Have fun :)

no