Home >Web Front-end >HTML Tutorial >html css implementation method to control div or table to be fixed at specified position

html css implementation method to control div or table to be fixed at specified position

高洛峰
高洛峰Original
2017-02-18 15:51:232166browse

.bottomTable{    
background-color: rgb(249,249,249);    
z-index:99999999; position:fixed; bottombottom:0; left:0; width:100%; _position:absolute; /* for IE6 */  
/* _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight);    */  
_top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); /* for IE6 */  
overflow:visible;   
 }

1. z-index: Set the layer to be at the top level.

2. position:fixed; set positioning.

3. _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); Bind js through css to control the height of the layer from the top,

The control layer is at the bottom, and the specific values ​​should be adjusted accordingly according to needs.

4. document.body.scrollTop: body, the scrolling distance of the body label scroll bar, can be replaced by your other label objects (scroll bars exist).

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

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

The above html css method of controlling div or table to be fixed at a specified position is all the content shared by the editor. I hope it can give you a reference, and I hope everyone Duoduo supports PHP Chinese website.

For more html css methods to control divs or tables to be fixed at designated positions, please pay attention to the PHP Chinese website for related articles!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn