0

i have the textarea..

<textarea name='content' id='content'   wrap='soft' style='background-image: url(\"frontinput.jpg\");color: #000000;font-size:12px;font-family:Arial;width:445px; height:77px;border:none; padding:5px;'></textarea>

when i display in the div.. the text doesn't fill up the div. the text goes 75% of the way and then line breaks.

here is the css for the div.

.message {
float:left;
width:98%;
background-color:#EFEFEF;
border: 1px solid black;
padding:4px;
overflow:auto;
margin-left:3px;
min-height:120px;


}

How do i get the text to go to the end of the div and then line break?

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by teedoff
1

Looking at your CSS code

.message {
float:left;
width:98%;
background-color:#EFEFEF;
border: 1px solid black;
padding:4px;
overflow:auto;
margin-left:3px;
min-height:120px;


}

You have told the div to make more space than you anticipated I think.

You have the text at 98%, so it is already taking up less of the space.

You have padding, giving even more space around the text, I am not sure if you have tried different values for that yet.

and, you have it 3px from the 4px padding you set for the margin.

Maybe try removing the width percentage, since you already have space with the padding. Its the only thing I can see looking at the code off hand.

Votes + Comments
Good Eye :)
0

OH I just looked at your HTML code too - you have another padding statement in that, adding to the extra space around your text. Take out the padding from the HTML code since the CSS will take care of that, if you need it.

0

remember, inline styles take top priority, then embedded styles and then finally external styles. If you have a margin styles with 5 px, then have the same margin styled again, the inline style will be the one that is used. Take out all margin styles in your page and your css page. I have made it a habit of anytime I create a style, whether embedded or external, to set all margins and paddings to "0" first. Then when you need to change either one, you can. It's like starting with a blank canvas, but making sure the canvas is clean so that your painting will start off right.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.