Home > Web Front-end > Bootstrap Tutorial > How to implement scroll bars in bootstrap

How to implement scroll bars in bootstrap

WBOY
Release: 2022-02-15 10:08:12
Original
6812 people have browsed it

Implementation method: 1. Use the "

<div class="pre-scrollable">" typesetting class to implement the scroll bar; 2. Use "
" implements the scroll bar.

How to implement scroll bars in bootstrap

The operating environment of this tutorial: Windows 10 system, bootstrap version 3.3.7, DELL G3 computer

How to implement scroll bars in bootstrap

1: Add bootstrap style to add scroll bars

In fact, just add pre-scrollable to the class attribute of the relevant module.

For example, add pre-scrollable in

:
<div class="pre-scrollable">
Copy after login

How to implement scroll bars in bootstrap

2: Add scroll bar by setting overflow

<div   style="max-width:90%"https://img.php.cn/upload/image/676/898/602/1644890761462693.png" title="1644890761462693.png" alt="How to implement scroll bars in bootstrap"/></p><pre class="brush:html;toolbar:false"><div style=" overflow-y:auto; overflow-x:auto; width:400px; height:400px;”></div>
Copy after login

Remember that the width and height must be set, otherwise it will not work. The better thing is that when the width and height do not exceed, it is just a line.

How to implement scroll bars in bootstrap

Three: Just specify the overflow attribute for the div as auto directly, but you must specify the height of the div, as follows:

<div   style="max-width:90%"></div>
Copy after login

How to implement scroll bars in bootstrap

If you want a horizontal scroll bar to appear, then: overflow-x:auto

Similarly, the vertical scroll bar is: overflow-y:auto

If the div is included in other objects such as td, the position can be set to relative: position:relative

3: Hide scroll bar

{overflow: hidden !important;} or {overflow-x: hidden; overflow-y: hidden;} can hide the x-axis or y-axis scroll bar respectively

Related recommendations: bootstrap tutorial

The above is the detailed content of How to implement scroll bars in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template