tags:

views:

12

answers:

1

I have an html form where the width of a textarea is specified with cols=. I want the textarea to have a specific width in terms of number of characters.

However, I also want some controls to be right-justified to the right edge of the textarea. They're not in the textarea, but directly above or below it. Is it possible to do this?

I was thinking a possible approach might be enclosing the textarea with some type of container that could grow to the width of the textarea, but I'm not sure how I could right-justify text within that.

+3  A: 

Like this:

.Container {
  position: relative;
  float:left;
}
.Inner {
  position: absolute;
  right: 0;
}  

<div class="Container">
  <textarea cols="50"></textarea>
  <div class="Inner">Right edge!</div>
</div>
SLaks