-1

I have a div element with to resize:vertical style on it. The contents of the div are generated, so it could be empty or filled. The div needs a max height, so that the height increases as new items are added, but it caps the size at 150px and makes the div scrollable. I could easily accomplish that with the max-height style, but if I want to resize it, it doesn't work.

The second idea I had, was to just use the height style, but by doing this, the div's not adjusting its height if the contents are smaller than 150px.

Is there any way of doing this without javascript?

jangxx
  • 900
  • 1
  • 9
  • 20

1 Answers1

0

I don't think this is possible without JavaScript and even if it would be: What do you want this for? Please take a look at browser support of resize!

(What do you mean by "filled" - is this done via PHP or JS? Actually no matter which one you use, you could check if there is any content and if so add an .empty class to the div)

Peter
  • 926
  • 9
  • 22
  • Then I'd go for my proposed solution - add some accessibility by adding classes and btw: There are other users that don't use Chrome. – Peter Nov 08 '12 at 21:09