绝对定位在文本区域中对齐

发布于 2024-12-26 14:17:47 字数 274 浏览 1 评论 0原文

我想实现这样的目标。 http://jsfiddle.net/dpnay/。右下角会出现一个文本区域,其中包含一些文本和名称。到目前为止,我使用绝对定位来修复名称文本。

我的问题是,当我输入长文本时,我输入的文本将覆盖名称文本(除非我向下滚动按钮)。有什么解决方案可以使用 CSS 使 textarea 上的文本不覆盖名称文本吗?因为我还没有准备好使用javascript。

谢谢你的建议。

I want to achieve something like this. http://jsfiddle.net/dpnay/. A textarea with some text inside and a name appear right down corner. So far I used absolute positioning to fixed the name text.

My problem is, when I type a long text, the text I typed will cover the name text (unless I scroll down the button). Is there any solution to make the text on textarea didn't cover the name text by using CSS? Because I'm not prepare for using javascript.

Thanks for the advice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韵柒 2025-01-02 14:17:47

最简单的解决方案是将“签名”文本实际放置在文本区域下方,但仅将边框放置在周围的 div 上。我在 此处 上用 jsFiddle 上的 CSS 制作了一个示例。

The easiest solution is to actually put the "signature" text below the textarea, but only put the border on the surrounding div. I've made an example from the CSS on your jsFiddle here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文