View Full Version : Css word wrap

daler mehndi
05-17-2005, 12:05 AM
I have the following chunk of code in my web site
First off, the [.updates . article .main] <div> has the text pushed to to right a couple Em's.
Second, wordwrap doesn't work. The text is one line that keeps going off into the space to the right of the screen.

Im using mozilla, firefox, and IE, any ideas?

EDIT: I've attached an image of the bug


.updates .article{
position: relative;
left: 0em;
width: 35em;
border-color: #555555;
border-style: solid;
border-width: 1px;
padding: 0em;
font-size: 14px;
margin-bottom: 2em;
.updates .article .title{
padding: 0em;
position: relative;
top: 0;
left: 0;
background-color: #CCCCCC;
width: 100%;
cursor: move, defualt;
.updates .article .main{
word-wrap: break-word;
padding-left: 0em;
padding-top: 1px;
padding-right: .5em;
padding-bottom: 1px;

<div class="updates">
Recent updates:
<div class="article">
<div class="title">&nbsp;Test article for new site</div>
<div class="main"><pre>
This is where important information will appear.-----------------------------------------------------------------------------------------

05-17-2005, 01:39 AM
.main pre

05-17-2005, 03:37 PM
Why do you use a pre element to preserve formatting and at the same time want the text to wrap? Why do those rules need three classes in their selector where one would suffice?
By the way: word-wrap is a proprietary MS property and is not part of the current standards, and by the looks of it doesn't appear -in this form- in the next CSS spec (3) either.

daler mehndi
05-17-2005, 10:47 PM
Thanks, I didn't even see that <pre> tag in there.
This has been one of those project I've see aside to come back to a few weeks latter.