我想在我的文本区域的右上角添加一个 div/文本。
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;
}
需要做哪些调整?
jsFiddle: http://jsfiddle.net/zrpgK/
最佳答案
工作 jsfiddle 代码 jsfiddle
div#textarea-container {
position: relative;
float: left;
}
div#copy {
position: absolute;
right: 5px;
top: 0;
}
关于html - 在 textarea 上定位文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15577166/