Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Position text over textarea

Tags:

html

css

I would like to add a div/text to the top right corner of my textarea.

HTML

<div id="textarea-container">
    <textarea></textarea>
    <div id="copy">copy</div>
</div>

CSS

div#textarea-container {
    position: absolute;
}

div#copy {
    position: relative;
    right: 0;
}

What adjustments need to be made?

jsFiddle: http://jsfiddle.net/zrpgK/

like image 686
O P Avatar asked Mar 22 '13 18:03

O P


1 Answers

Working jsfiddle code jsfiddle

div#textarea-container {
   position: relative;
   float: left;
}
div#copy {
   position: absolute;
   right: 5px;
   top: 0;
}
like image 173
Anoop Avatar answered Sep 28 '22 07:09

Anoop