Solution for mobile browsers not supporting position: fix

Solution for mobile browsers not supporting position: fix

The specific method is as follows:

CSS Code


Copy code
The code is as follows:

.wap_bottom {
height: 60px;
width: 100%;
position: fixed;
z-index: 2;
bottom: 0;
left: 0;
opacity: 0.7;
}

HTML code


Copy code
The code is as follows:
<div class="wap_bottom"> <a href="https://www.jb51.net" target="_blank"></a></div>

Note: Generally speaking, when people write a float, they use position: fixed; in CSS to control it. However, this method only works on the computer side, but not on the mobile side. The effect is that when you use a mobile browser to open the web page, it is displayed at the bottom, but when you scroll down, the float does not follow. At this time, you need to add the following code between the head to solve the bug that the mobile browser does not support position: fixed.


Copy code
The code is as follows:
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">

<<:  JavaScript implements AI tic-tac-toe game through the maximum and minimum algorithm

>>:  Linux configuration without password login stand-alone and full distribution detailed tutorial

Recommend

Zen coding resource update function enhancement

Official website: http://code.google.com/p/zen-cod...

Use thead, tfoot, and tbody to create a table

Some people use these three tags in a perverted wa...

Vue implements sending emoticons in chat box

The specific code for sending emoticons in the vu...

Vue implements horizontal beveled bar chart

This article shares the specific code of Vue to i...

Application examples of WeChat applet virtual list

Table of contents Preface What is a virtual list?...

SQL Practice Exercise: Online Mall Database User Information Data Operation

Online shopping mall database-user information da...

Example usage of Linux compression file command zip

The ".zip" format is used to compress f...

JavaScript data structure bidirectional linked list

A singly linked list can only be traversed from t...

View the port number occupied by the process in Linux

For Linux system administrators, it is crucial to...

Specific operations of MYSQL scheduled clearing of backup data

1|0 Background Due to project requirements, each ...

A brief discussion on common operations of MySQL in cmd and python

Environment configuration 1: Install MySQL and ad...

Using vue3 to imitate the side message prompt effect of Apple system

Table of contents Animation Preview Other UI Libr...

How to export mysql table structure to excel

The requirements are as follows Export the table ...

Web standards learning to understand the separation of structure and presentation

When discussing Web standards, one thing that alwa...

CSS uses BEM naming convention practice

When you see a class, what information do you wan...