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???
Text wraping
Moderator: General Moderators
Re: Text wraping
The short answer: overflow:auto;
The longer answer/demo:
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
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>Re: Text wraping
Well , I actually need to break long strings ...
Anybody please give me that javascript wizadry
!!
Anybody please give me that javascript wizadry
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Text wraping
You shouldn't be breaking user input at all.
Also, you should be limiting your questions to one thread.
Also, you should be limiting your questions to one thread.
Re: Text wraping
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.