Sample code for displaying a scroll bar after the HTML page is zoomed out

Sample code for displaying a scroll bar after the HTML page is zoomed out

Here is a record of how to make a scroll bar appear at the bottom after the HTML page is reduced in size, so that you can scroll the scroll bar to browse the areas that are covered by the reduced interface.

Talk about the benefits of doing this.

First of all, generally, when the interface is reduced in size, no scroll bar appears, and users cannot access hidden areas, so the interface must be enlarged.

Secondly, due to the relative or absolute layout of some interfaces, as the interface becomes smaller, the interface on the right will move to the bottom, which may make the interface layout unsightly. The most worry-free method is to display the scroll bar after shrinking it.

The implementation is very simple, just a few lines of code

body{
    min-width: 1200px;
    overflow: scroll;
    /*max-width:100%;*/
}

Knowledge point expansion:

Scroll bar appears automatically when html page is zoomed out

Just import this style and set the attributes in the body as required.

<style>

body{
  margin:0px;
  width:100%;
  min-width:1500px;
  max-width:100%;
  height:100%;
  background-color:#F0F0F0;
}
#head{
  background-color:#FFFF00;
  width:100%;
  height:100px;
}
#center{
  background-color:#00FFFF;
  width:100%;
  min-height:100%;
}
#foot{
  background-color:#FF00FF;
  width:100%;
  height:100px;
}
</style>

This is the end of this article about the sample code for displaying a scroll bar when the HTML page is reduced in size. For more related content on displaying a scroll bar when the HTML page is reduced in size, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future!

<<:  A detailed introduction to the CSS naming specification BEM from QQtabBar

>>:  Sublime / vscode quick implementation of generating HTML code

Recommend

MySQL 8.0.15 installation and configuration graphic tutorial under Win10

This article records the installation and configu...

The difference between delete, truncate, and drop and how to choose

Preface Last week, a colleague asked me: "Br...

Detailed explanation of the use of stat function and stat command in Linux

stat function and stat command Explanation of [in...

Detailed steps to install JDK and Tomcat in Linux environment

Table of contents 1. Install JDK Manual Installat...

Realization of real-time file synchronization between Linux servers

Usage scenarios For existing servers A and B, if ...

MySql index detailed introduction and correct use method

MySql index detailed introduction and correct use...

CocosCreator implements skill cooling effect

CocosCreator realizes skill CD effect There are s...

A Brief Analysis on the Time Carrying Problem of MySQL

The default time type (datetime and timestamp) in...

Web Design: When the Title Cannot Be Displayed Completely

<br />I just saw the newly revamped ChinaUI....

Implementing custom scroll bar with native js

This article example shares the specific code of ...

Detailed tutorial on installing Python 3.6.6 from scratch on CentOS 7.5

ps: The environment is as the title Install possi...

The most comprehensive explanation of the locking mechanism in MySQL

Table of contents Preface Global Lock Full databa...

How to quickly modify the root password under CentOS8

Start the centos8 virtual machine and press the u...

Problems with join queries and subqueries in MySQL

Table of contents Basic syntax for multi-table jo...