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

A brief discussion on JS packaging objects

Table of contents Overview definition Instance Me...

Why can't my tomcat start?

Table of contents Phenomenon: Port usage: Spellin...

JavaScript data transmission between different pages (URL parameter acquisition)

On web pages, we often encounter this situation: ...

How to get the contents of .txt file through FileReader in JS

Table of contents JS obtains the .txt file conten...

IDEA complete code to connect to MySQL database and perform query operations

1. Write a Mysql link setting page first package ...

Steps to encapsulate the carousel component in vue3.0

Table of contents 1: Encapsulation idea 2. Packag...

How to run Spring Boot application in Docker

In the past few days, I have studied how to run s...

Install Centos7 using Hyper-v virtual machine

Table of contents introduce Prepare Download syst...

Five ways to implement inheritance in js

Borrowing Constructors The basic idea of ​​this t...

How to achieve centered layout in CSS layout

1. Set the parent container to a table and the ch...

Basic operations on invisible columns in MySQL 8.0

Table of contents 01 Create invisible columns 02 ...

A brief talk on responsive design

1. What is responsive design? Responsive design i...

Detailed explanation of the role of explain in MySQL

1. MYSQL index Index: A data structure that helps...

Vue implements graphic verification code login

This article example shares the specific code of ...