Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 03-29-2004, 02:17 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Stop text expanding in a cell.

Using CSS how can I stop text from pushing all the layout to the right in my design.

In one cell, i have as a bg image, if i type into this cell it's kool until the text hits the end of the first line, then blam.


Anyone know?
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 03-29-2004, 03:50 PM
LazyJim's Avatar
LazyJim LazyJim is offline
v7n Mentor
 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
even if you could find an answer, ppl could still resize the text causing overflow again.

but anyway, try overflow: hidden; - although it might not work on table cells - use <div>s!
 
Reply With Quote
  #3  
Old 03-29-2004, 04:11 PM
greg's Avatar
greg greg is offline
Senior Member
 
Join Date: 10-13-03
Location: Little Rock
Posts: 1,184
iTrader: 0 / 0%
you can also set the overflow to scroll and will simply create a scroll bar to go for the extra text.
 
Reply With Quote
  #4  
Old 03-29-2004, 04:33 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
No scroll bars are no good lmao; this is on a template.

LJ, but they can only do that in Firebox or whatever, if i set the text at a fixed size 97% of the internet population can't.

Im not too concerned about the fad browsers.

Ill try what you said though. The main problem is that the text just keeps going in a straight line, where I want it to break when it hits the wall of the cell.
 
Reply With Quote
  #5  
Old 03-29-2004, 04:42 PM
Jazzee Jazzee is offline
No Longer Here
 
Join Date: 09-27-03
Location: State College, PA
Posts: 4,273
iTrader: 0 / 0%
You can make the table cell have a set width.
 
Reply With Quote
  #6  
Old 03-29-2004, 04:58 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Thanks Jazzee, I just tried it and still the text pushes the cells over.

This is the code atm:

<td class="welcome" colspan="4" rowspan="10" width="259" height="253" valign="top">
<p class="textwelcome"> testsssssssssssssssss</p>
</td>



The CSS
.textwelcome {color:red; margin-left:20px; margin-top:30px; margin-bottom:10px; text-overflow:hidden;}
 
Reply With Quote
  #7  
Old 03-29-2004, 05:02 PM
Jazzee Jazzee is offline
No Longer Here
 
Join Date: 09-27-03
Location: State College, PA
Posts: 4,273
iTrader: 0 / 0%
Can you show us the page?
 
Reply With Quote
  #8  
Old 03-29-2004, 05:03 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
What in the messed up state, LOL yah sure.
 
Reply With Quote
  #9  
Old 03-29-2004, 05:15 PM
greg's Avatar
greg greg is offline
Senior Member
 
Join Date: 10-13-03
Location: Little Rock
Posts: 1,184
iTrader: 0 / 0%
it is because you have no break in your text. in normal writing you make space breaks in between words, and it simply wraps the text to fit that.

For example, all the above automatically wraped to fit the cell that it is in. But however if i type one continuous thing like:
greggreggreggreggreggreggreggreggreggreggreggreggr eggreggreggreggreggreggreggreggreggreggreggreggreg greggreggreggreggreggreggreggreggreggreggreggreggr eggreggreggreggreggreggreggreggreggreggreggreggreg greg
it pushes the rest of the cell outward because internet standards are not designed to break up text in the middle of a word
 
Reply With Quote
  #10  
Old 03-29-2004, 05:17 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Quote:
Originally Posted by greg
it is because you have no break in your text. in normal writing you make space breaks in between words, and it simply wraps the text to fit that.

For example, all the above automatically wraped to fit the cell that it is in. But however if i type one continuous thing like:
greggreggreggreggreggreggreggreggreggreggreggreggr eggreggreggreggreggreggreggreggreggreggreggreggreg greggreggreggreggreggreggreggreggreggreggreggreggr eggreggreggreggreggreggreggreggreggreggreggreggreg greg
it pushes the rest of the cell outward because internet standards are not designed to break up text in the middle of a word

Bingo, nailed it. I hope this can help others. Also Jazee was right about the fixed width!

Thanks Greg.
 
Reply With Quote
  #11  
Old 03-29-2004, 05:18 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Really weird lol
 
Reply With Quote
  #12  
Old 03-30-2004, 03:06 AM
LazyJim's Avatar
LazyJim LazyJim is offline
v7n Mentor
 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
did u manage it yet?
you can hide the overflowed text by setting the <p> to width:100%; i think (so it has a set width and the overflow: hidden; should then work).
 
Reply With Quote
  #13  
Old 03-31-2004, 01:45 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
It was what Greg said, I was just typing in a load of words. When broken up and using the postioning of CSS its awesome. But for the life of my pansies I can't get the font size to change :@ Funny...
 
Reply With Quote
  #14  
Old 03-31-2004, 01:47 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Is that what overflow does then? Stops it dead?
 
Reply With Quote
  #15  
Old 03-31-2004, 06:09 PM
LazyJim's Avatar
LazyJim LazyJim is offline
v7n Mentor
 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
overflow is what happens when the content gets too big for the containing block.
the CSS overflow property allows you to say what you'd like to happen when overflow occurs.
Tou can ask for scroll bars to appear, ask the bits of content that extend out of the containing block to be cropped or you can ask the containing block to expand to fit all the content in.
- Thats overflow: auto; overflow: hidden; and overflow: visible; respectively. visible is the default, and some browsers get confused if you forget to tell them the dimensions of that containing block, so set the width/height and overflow properies on your <div> elements, (and if you use tables, nest your <div>s inside your <td>s or preferable, stop using tables!).
 
Reply With Quote
  #16  
Old 03-31-2004, 07:08 PM
Fusion's Avatar
Fusion Fusion is offline
Contributing Member
 
Join Date: 03-08-04
Posts: 1,268
iTrader: 0 / 0%
Cheers LazyJim.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS div width / DIV with aut expanding width depending on content cheska Web Design Lobby 3 02-04-2008 11:37 AM
Military Is Expanding Its Intelligence Role in U.S. Ferre Controversial Social Issues 0 01-14-2007 09:23 AM
Debt Free and Growing Slowly or In Debt and Aggressively Expanding? John Scott Webmaster Revenue 31 10-21-2006 12:39 PM
Can't get text to stop going to next line sim Web Design Lobby 2 10-03-2006 04:46 PM
Expanding My Website From a Business Perspective SFC Webmaster Revenue 4 12-08-2004 07:29 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:38 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC