如何将滚动条添加到div? [英] How to add scrollbar to a div ?

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

问题描述

如何在div中添加滚动条?我尝试了overflow:auto.这仅在mozila中有效.我需要在所有浏览器中都适用的代码吗?是否有任何代码可在所有浏览器中使用..请帮助meeee

How is it possible to add a scrollbar in div.I have tried overflow:auto .this works only in mozila.I need a code that work in all browsers? Is there any code that works in all browser ..Pls help meeee

推荐答案

overflow:auto在所有浏览器中均可使用.首先,您需要了解它的含义.自动=>每当需要滚动时,它就会出现或不出现.

如果要一直显示滚动,请将其放在CSS样式表/样式元素中:
overflow:scroll;

如果指定x或y,则:
overflow:auto works in all browsers. First you need to understand what it means. Auto => whenever there is a need of scroll it will appear or else not.

If you want to show scroll all the time, put this in your CSS stylesheet/Style element:
overflow:scroll;

if specific x or y then:
overflow-x:scroll;<br />
overlfow-y:scroll;


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

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