• Welcome to Baben's blog that year. I'm glad to meet you at the right age!
  • Due to the theme, the QQ login partner displays the default avatar in the comments. Please go to the personal center to upload the avatar again.

CSS penetration: put divs on the top without affecting the clicking of the lower elements

Code Notes barben Five years ago (2019-10-22) 37644 views 2 comments

case analysis

There is a div with copyright information on the page. Set the fixed location at the bottom.
Every time I open the console, this div will mask the "Login Now" button.
Because after the page height changes, the fixed positioning will make the div move up, which just blocks the buttons below.


I have to realize now: The div is displayed on the top but does not cover the elements below

Use point events to penetrate

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

 /*The code of the elements below is not obscured by the element mask layer*/ -webkit-pointer-events: none; -moz-pointer-events: none; -ms-pointer-events: none; -o-pointer-events: none; pointer-events: none;

Eight blogs that year, we have been
If the author does not indicate that it is an original article, please indicate the link and source of this article for reprinting
CSS penetration: put divs on the top without affecting the clicking of the lower elements- https://www.barben.cn/code/626.html
Like( nine )
Post my comments
Cancel comment
expression Mapping Bold Strike through Center Italic

You need to bring your nickname and email with you in the review of Eight Books that year!

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