How to leave textarea and button next to each other?

Asked

Viewed 240 times

0

I need to implement a textarea(message) and a button(send) on your right side, but it is liquid (100%), that is, if you decrease the size of the window the textarea decreases and the button keeps its size (60px for example) and always pasted on the right side of the window.

It is possible?

1 answer

2


Can be implemented with calc.

Jsfiddle

textarea {
    width: calc(100% - 60px);
}

button {
    position: fixed; right: 0; top: 0;
    width: 60px;
}
  • This solution is simpler than the previous one, the problem is the old browsers. ;)

  • There has been partial support since IE 9, the counting browsers have been supported for quite some time: http://caniuse.com/calc

  • Watch out for the CSS 3 supports. Now it’s up to Jefferson, who best applies his need. In my reply I’ve seen the way it works in every browser, because unfortunately it has places using IE 8 or lower that quite blocks the growth of CSS 3.

  • Your answer isn’t working yet @flpms

  • 1

    Well that I need. Thanks @Tiagocésaroliveira, and flpms.. I couldn’t implement with your example.. Thanks anyway!

  • Dispo @Jeffersonalison :)

  • No @Jeffersonalison, sorry I didn’t work more on something functional, I stayed away from a computer due to the holiday. I will continue searching for the solution in CSS 2.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.