Page 1 of 1
Text wraping
Posted: Wed Jun 04, 2008 6:10 am
by Monopoly
First of all , I suck in client-side ...
I have written a simple guestbook , but there is a problem :
In the text-area if you write a long continous string , the output on the main guestbook page
is also a long string that makes the browser "stretch" and a scroll bar appears...
I was told to ask client-side proggers....
Any solutions???
Re: Text wraping
Posted: Wed Jun 04, 2008 6:21 am
by matthijs
The short answer: overflow:auto;
The longer answer/demo:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<!-- Date: 2008-06-04 -->
<style type="text/css" media="screen">
* { margin:0;padding:0; }
body { background:#eee;}
#box { width:300px;margin:100px auto;border:1px solid #bbb;background:#fff;overflow:auto;}
p { margin:10px; }
</style>
</head>
<body>
<div id="box">
<p>bhjbjbjhhhhhhhhhhhhhhhhhhhhhhhccccccccccccccccciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiddddddddddddddd</p>
</div>
</body>
</html>
If you want to somehow break the long strings to make them fit you'll need some javascript wizzardry. But I wouldn't go to that trouble. Your needs may be different off course
Re: Text wraping
Posted: Wed Jun 04, 2008 6:46 am
by Monopoly
Well , I actually need to break long strings ...
Anybody please give me that javascript wizadry

!!
Re: Text wraping
Posted: Wed Jun 04, 2008 7:26 am
by Kieran Huggins
You shouldn't be breaking user input at all.
Also, you should be limiting your questions to one thread.
Re: Text wraping
Posted: Wed Jun 04, 2008 7:39 am
by matthijs
Well, since you've expressed so much gratefulness for the help so far I bet people are in line to write something for you or help you google.