Not a Name
Not a Name

Reputation: 1003

How to make a box expand a distance from the sides

I'd like to know how you make it so that a box(textarea) would expand to fill space, but from a certain pixel distance (not percentage) just enough to fit a menu on each side. Is this possible?

I've tried as many CSS properties as I could find, but none of them seem to work correctly. (note, I'm fine with using javascript if required)

My specific page: http://pastebin.com/5adPwXEE

Upvotes: 1

Views: 136

Answers (1)

clairesuzy
clairesuzy

Reputation: 27624

Don't think you need javascript for this, you just need to isolate your chat division into a div (which is exactly what they're for ;))

This div will be 100% wide by default - then you margin it on both sides to clear your 2 x absolutely positioned lists.. then the textareas that sit inside it can be 100% of the "chat div".. you then remove the padding off the body element as you don't need it

I added div class="chat" and removed all unnecessary CSS

Example: here

Upvotes: 3

Related Questions