• Welcome to the eight year blog, I'm glad to meet you at the right age!
  • Due to the theme, QQ login partners will display the default avatar in the comments. Please go to the personal center and upload the avatar again.

CSS penetration: let div go to the top without affecting the element click below

Code Notes barben One year ago (October 22, 2019) 6515 views 2 comments

case analysis

The page has a div with copyright information, which is fixed at the bottom.
Every time I open the console, the div hides the "log in now" button.
Because after the page height changes, fixed positioning will make div move up, which just blocks the buttons below.


I have to do it now: Div is displayed at the top without blocking the elements below

Using pointer events to penetrate

You just need to use the following style for this div!

 /*The element mask layer does not block the code of the element below * / 
 - WebKit pointer events: none; 
 - Moz pointer events: none; 
 - MS pointer events: none; 
 - o-pointer-events: none; 
 - pointer events: none; 
 - pointer events: none;

Eight blogs that year, we've been there all the time
If the author does not indicate the original article, please indicate the link and source of this article
CSS penetration: put div on top without affecting the elements below click - https://www.barben.cn/code/626.html
Like it( six )
Post my comments
Cancel comment
expression Mapping Bold Strikethrough Center Italics

You need to bring your nickname and email with you in the year of eight!

  • Nickname (required)
  • Email address (required)
  • website
Successfully captured two A rare spirit
  1. Non technical passing by.
    repostone 2019-11-04 16:07 reply