471,881 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

Text not obeying width given.

Hey, I don't know what going on here...but the text in this div is running outside of the width I've given the div. Can someone PLEASE help me.

Here's the css:


.content_box_1{
background-repeat:repeat-y;
background-image:url(../images/box_1.jpg);
width:198px;
}

Here's the html:

<td class="content_box_1">
dshfjksdhfkjdfhkjshfkjsfhkjshfkjshjkldsjflksjflksj flkdsjflksd
</td>
Aug 14 '07 #1
6 1890
epots9
1,351 Expert 1GB
Hey, I don't know what going on here...but the text in this div is running outside of the width I've given the div. Can someone PLEASE help me.

Here's the css:


.content_box_1{
background-repeat:repeat-y;
background-image:url(../images/box_1.jpg);
width:198px;
}

Here's the html:

<td class="content_box_1">
dshfjksdhfkjdfhkjshfkjsfhkjshfkjshjkldsjflksjflksj flkdsjflksd
</td>
try breaking the word
Expand|Select|Wrap|Line Numbers
  1. content_box_1{ 
  2. background-repeat:repeat-y;
  3. background-image:url(../images/box_1.jpg);
  4. width:198px;
  5. word-wrap: break-word;
  6. }
  7.  
Aug 14 '07 #2
drhowarddrfine
7,435 Expert 4TB
You are trying to set the width of the cell but cell width is controlled by the width of the table and other cells.
Aug 14 '07 #3
try breaking the word
Expand|Select|Wrap|Line Numbers
  1. content_box_1{ 
  2. background-repeat:repeat-y;
  3. background-image:url(../images/box_1.jpg);
  4. width:198px;
  5. word-wrap: break-word;
  6. }
  7.  

that didn't work.any other ideas? i'd appreciate it.
Aug 14 '07 #4
alright, i made the class independant from the td. still no go.

<td>
<div class="content_box_1">
dshfjksdhfkjdfhkjshfkjsfhkjshfkjshjkldsjflksjflksj flkdsjflksd
</div>
</td>

any other ideas?
Aug 14 '07 #5
drhowarddrfine
7,435 Expert 4TB
The problem now is you don't give the browser anywhere to have the break. There are no spaces in that line. Well, there is one, but you have to add your <br> also.
Aug 14 '07 #6
The problem now is you don't give the browser anywhere to have the break. There are no spaces in that line. Well, there is one, but you have to add your <br> also.
F' in A. thanks so much!!!!
Aug 14 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by James Stroud | last post: by
8 posts views Thread by BiNZGi | last post: by
12 posts views Thread by paii, Ron | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.