如何在textarea之外做滚动条? [英] How to do scrollbar outside textarea?

查看:108
本文介绍了如何在textarea之外做滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以在<textarea>之外做滚动条吗?

Can anybody have to do scrollbar outside <textarea> ?

我发现了这样的内容 http://jsfiddle.net/jlmyers42/8tptqt19/但它对于teaxtarea无效.

I found something like this http://jsfiddle.net/jlmyers42/8tptqt19/ but it doesnt work for teaxtarea.

最好只使用css和html.

The best will be using only css and html.

先谢谢您了:)

推荐答案

如果您的意思是,在该特定元素之外有一个滚动条,您可以像这样将其封装在div中.

If you mean, have a scroll bar outside of that particular element you could encapsulate it within a div like so.

<div style="overflow-y: scroll; overflow-x: hidden; height: 100px">
   <textarea style="overflow-y:auto;" placeholder="Enter Notes here (optional)"></textarea>
</div> 

http://jsfiddle.net/ga0e66oz/
当您需要滚动时,将显示滚动条.试试看.

http://jsfiddle.net/ga0e66oz/
The scrollbar will appear when you need to scroll. Give it a try.

这篇关于如何在textarea之外做滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆