Okay, I know that this question has been asked many times because I searched here on the board. However, I am trying to figure out how to go about getting a div to auto resize without me telling it what size to go to. I hope that makes sense?
Kind of like when someone types content inside a box and that box stretches to fit the text. I hope that makes sense? Here is what the code I'm working with:
Code:
<div style="border:1px solid #c9d2d8;background-color:#ffffff;padding:5px;">
<b>Movie: </b><u>{SIMPLETEXT1}</u><br /><hr />
<img src="./images/rating/{SIMPLETEXT2}.png" width="100" height="20" alt="This movie was rated {SIMPLETEXT2} stars out of 5" title="This movie was rated {SIMPLETEXT2} stars out of 5" />
</div>
Now ignore the {SIMPLETEXT1} and {SIMPLETEXT2}.
What this is going to do is allow someone to enter in text for the movie title ({SIMPLETEXT1}), and then enter in the rating which is for example 1.5 ({SIMPLETEXT2}).
I hope this makes sense?
Now as it is, the box is automatically perfect on the height, it's the width that is driving me crazy. It automatically stretches across when it shouldn't.
Basically if someone puts in:
Movie: Bride Wars
Rating
The box is from the left of Movie all the way to as far as it can go here in this post for example. Hm, I hope this makes sense. I'm trying to explain it. lol
Hm, actually here's a screen of what it looks like and how it renders:
Now I want the box to just stretch only if it needs to. Like say just after Bride Wars is typed in there, the box stops instead of continually grows like it does in the upper picture.
Any ideas of what I'm doing wrong with the box width?
Last edited by Shorte85; 07-05-2009 at 01:31 PM..
Reason: Took off the height and width 100% off there, forgot to do that
|