473,378 Members | 1,067 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1914
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

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

Similar topics

8
by: James Stroud | last post by:
Hello All, I would like for a tkinter text widget to be aware of how big the frame that contains it is, then I would like for it to reset its width to the appropriate number of characters when...
2
by: Kai Grossjohann | last post by:
I would like to put a text input field (in the sense of <input type="text">) and an image next to each other, where I know the size in pixels of the image, and I know the total width in em. I...
8
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor...
4
by: jawolter | last post by:
I have text that is too long to nicely fit on a given page, so I want to add ellipses to the end that dynamicaly resize based on the person resizing the page width. If you hover it would show the...
7
by: hawat.thufir | last post by:
Given an xhtml file, how can I "export" the data to plain-text? That is, I want: google www.google.com Whereas, if I copy and paste what the browser shows, I lose the URL and end up with:...
12
by: paii, Ron | last post by:
Sorry about that last one. Does anyone know how to calculate the width a string of text for given Font name and size? I want to buildup a block of text strings to display in a unbound control,...
3
by: Dom | last post by:
In part of my code, I need to know the rectangle that a string will fit into, if it is written in a given font and a given Device Context (DC may be an old term). Back in the days of "C" and...
1
by: rynato | last post by:
I have a <spanof width X px and height Y px. I want to read the text of an article, which is stored in a mySQL table, and pass to that <spanonly just enough text to fit in it, along with a 'read...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.