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

Do you know how many connections a Linux server can handle?

Preface First, let's see how to identify a TC...

Several ways to store images in MySQL database

Usually the pictures uploaded by users need to be...

The easiest way to make a program run automatically at startup in Linux

I collected a lot of them, but all ended in failu...

Advantages and disadvantages of Table layout and why it is not recommended

Disadvantages of Tables 1. Table takes up more byt...

Summary of the application of decorative elements in web design

<br />Preface: Before reading this tutorial,...

Detailed explanation of how to quickly build a blog website using Docker

Table of contents 1. Preparation 2. Deployment Pr...

Problems with creating placeholders for HTML selection boxes

I'm using a placeholder in a text input and i...

CSS border half or partially visible implementation code

1. Use pseudo-classes to display half of the Bord...

Briefly describe how to install Tomcat image and deploy web project in Docker

1. Install Tomcat 1. Find the tomcat image on Doc...

Where is the project location deployed by IntelliJ IDEA using Tomcat?

After IntelliJ IDEA deploys a Javaweb project usi...

JavaScript mobile H5 image generation solution explanation

Now there are many WeChat public account operatio...

A brief discussion on the types of node.js middleware

Table of contents Overview 1. Application-level m...