Jump to content

[SOLVED] how to keep text within a certain area


Recommended Posts

i have a piece of text in a variable(which people can edit)

this text needs to be displayed down the page and should stay within the bounderies i set, but it isn't. here are some snippets from my code.

$intro = "Welcome, this is a test of the sites features.Please go to the admin centre to cutomise the site.";

<p class="welcome"><?php echo"$intro"; ?></p>

 

p.welcome
{
color:#000;
font-size:14px;
text-align:center;
margin-left:425px;
margin-top:40px;
width:400px;
border:ridge #0000FF;
}

this is the site, you can see that it isn't working and what it is doing wrong.

http://deanwhitehouse.awardspace.co.uk/home.php

with ********* it does what you see on the page, and if i use words like "thisistext" it does work, why is this??

ok, i tried the wordwrap code, and it doesn't seem to apply wrap to the second line.

 

$intro = "Welcome, this is a test of the sites features.Please go to the admin centre to cutomise the site.TEXTTEXTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT";
$welcome = wordwrap($intro, 60, "<br />\n");


<p class="welcome"><?php echo"$welcome"; ?></p>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.