Jump to content

Recommended Posts

Hi,

 

I am querying a mysql database to get the text of a news story

 

But I have a problem. If the text is really long rather than wrapping down to the next line it just carries on and stretches the screen horizontally.

 

Is there a way I can force it to wrap once it reaches the edge of the box ?

 

Here is the design I'm using:

 

http://www.axac22.dsl.pipex.com/

 

I'm trying to put the text in the center box

 

 

Thanks :D

 

Link to comment
https://forums.phpfreaks.com/topic/172888-force-text-to-wrap-at-edge-of-box/
Share on other sites

Hi,

 

Thanks for the reply heres my CSS if it helps

 

/* CSS to control colours and alingment in all browsers except IE 7 and below */

/* Unkown probably layout rules */
.equal {
	display:table;
	border-collapse:separate;
}
.row {
	display:table-row;
}
.row div {
	display:table-cell;
}


/* Styling rules to make the example look nicer */
html,body {
background: #000000;     /* Page background colour */
}
body {
	font:76%/140% "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
}

/* Box behind the three columns NOT page */

.equal 
{
margin:10px auto;
border-spacing:10px;
background:#FFCC00; 
width:100%;
}

/* Left column, Navigation */

.row div.one 
{
background: #F72406; 
width: 15%;
}

/* Middle Column */

.row div 
{
background: #0066FF; 
}

/* Right Colum */
.row div.three 
{
background: #33CC99;
width: 15%;
}

/* Banner */	
.banner 
{
height: 10%;
}

/* Footer */

#footer 
{
text-align:center;
background: #FFFFFF;
}


/* Fonts */

a.bargains:visited {color: #0000CC}
a.bargains:link {color: #0000FF}
.bargains { font-size:16px}

.Headings
{
font: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
font-size: 18px;
}

.Sub_Headings
{
font: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
font-size: 16px;
}

.Standard_Text
{
font: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
font-size: 14px;
}

a:link {
color: #FFFFFF;
font: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
}

a:visited {
font: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
color: #CCCCCC;
}

You could use overflow: hidden; but then the overlapping text would be also hidden. Or overflow: scroll; to make it scrollable but still keep the width. Or consider wrapping the text in the php side with wordwrap() before echoing it.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.