HTML:如何为长段创建只有垂直滚动条的DIV? [英] HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?

查看:135
本文介绍了HTML:如何为长段创建只有垂直滚动条的DIV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的网站上显示条款和条件说明。我不想使用文本字段,也不想使用我的整个页面。我只想在选定区域显示我的文字,并且只想使用垂直滚动条来阅读所有文本。

I want to show terms and condition note on my website. I dont want to use text field and also dont want to use my whole page. I just want to display my text in selected area and want to use only vertical scroll-bar to go down and read all text.

目前我使用的代码: / p>

Currently I am using this code:

<div style="width:10;height:10;overflow:scroll" >
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
 text text text text text text text text text
</div>

两个问题:


  1. 它不是固定的宽度和高度和传播,直到所有文本出现。

  2. 第二个是显示水平滚动条,我不想显示它。


推荐答案

请参阅 overflow-y 。它是CSS 3。

See overflow-y. It's CSS 3.

这篇关于HTML:如何为长段创建只有垂直滚动条的DIV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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