views:

622

answers:

3

I am building new site FF and IE compliant...what is best way to have sentences wrap to fill container in firefox? This works in IE without any problem.

Currently I am using the following doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

thanks

A: 

Try adding the following to your CSS

#container {overflow: auto;}

Or

#container {overflow: hidden;}
Keith Maurino
+1  A: 

Tried a test case:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html>
<head>
<style>
.articleContent { width:200px;
}
</style>
</head>
<body>
<table><tr><td> <div class="articleContent" > this is a sentence that goes on and on. this is a sentence that goes on and on. this is a sentence that goes on and on. this is a sentence that goes on and on. this is a sentence that goes on and on. </div> </td></tr></table>
</body>
</html>

Renders fine in FF/konq. Sounds like your CSS is getting overridden somewhere.

jim
A: 

You may mean something along the lines

div.mydiv {
    width: 400px;
    height: auto;
    text-align: justify;
    overflow: hidden;
}

I don't think there is anything controlling breaks between words: they always occur as necessary.

ilya n.