How to use html css to control div or table to be fixed in a specified position

How to use html css to control div or table to be fixed in a specified position
CSS CodeCopy content to clipboard
  1. .bottomTable{
  2. background-color : rgb (249,249,249);
  3. z-index :99999999; position : fixed ; bottom : 0 ; left : 0 ; width : 100%; _position: absolute ; /* for IE6 */   
  4. /* _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight); */   
  5. _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); /* for IE6 */   
  6. overflow : visible ;
  7. }

1. z-index: Set the layer to be on the topmost layer.

2. position: fixed; set the positioning.

3. _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); Control the height of the layer from the top by binding js with css.

Here the control layer is at the bottom, and the specific values ​​are adjusted accordingly according to needs.

4. document.body.scrollTop: body, the scrolling distance of the body tag scroll bar, which can be replaced by other tag objects (with scroll bars).

5. document.body.clientHeight, the height of the body tag, can be replaced with other tag objects.

6, -6, and make corresponding changes according to the specific situation.

The above article on how to use html css to control div or table to be fixed in a specified position is all I want to share with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/skycsdn/archive/2016/06/13/5580009.html

<<:  MySQL tutorial thoroughly understands stored procedures

>>:  CSS3 flexible box flex to achieve three-column layout

Recommend

How to use Docker containers to implement proxy forwarding and data backup

Preface When we deploy applications to servers as...

Detailed explanation of triangle drawing and clever application examples in CSS

lead Some common triangles on web pages can be dr...

Sample code for partitioning and formatting a disk larger than 20TB on centos6

1. Server environment configuration: 1. Check dis...

11 ways to remove duplicates from js arrays

In actual work or interviews, we often encounter ...

MySQL database SELECT query expression analysis

A large part of data management is searching, and...

Learn how to use the supervisor watchdog in 3 minutes

Software and hardware environment centos7.6.1810 ...

Solve the problem of no my.cnf file in /etc when installing mysql on Linux

Today I wanted to change the mysql port, but I fo...

Alibaba Cloud applies for a free SSL certificate (https) from Cloud Shield

Because the project needs to use https service, I...

CSS method of clearing float and BFC

BFC BFC: Block Formatting Context BFC layout rule...

Detailed explanation of Nginx rewrite jump application scenarios

Application scenario 1: Domain name-based redirec...

Some suggestions for HTML beginners and novices, experts can ignore them

Feelings: I am a backend developer. Sometimes when...

How to use nginx to simulate canary release

This article introduces blue-green deployment and...

Solution to Navicat Premier remote connection to MySQL error 10038

Remote connection to MySQL fails, there may be th...

js uses the reduce method to make your code more elegant

Preface In actual projects, the most common proce...