css makes two divs overlap

PHP中文网
Release: 2017-06-07 09:23:56
Original
3277 people have browsed it

When I was making a web page, I put a weather plug-in from another web page in p, but when I clicked it, it would jump to the advertising page. I wanted to find a way to prohibit clicks on p on the Internet, but I found that there is no such method. I used the js method. It didn't seem to be successful. Later I thought it would be better to use two overlapping layers to prevent clicks, although positioning is a bit troublesome

<p style="position:relative">
<p style="position:absolute;left:0;top:0">
</p>
<p style="position:absolute;left:0;top:0">
</p>
</p>
Copy after login

relative means relative positioning. Absolute is absolute positioning. It's amazing that it won't work without one of them, but when put together, two p's in one p can overlap. www.w3school.com.cn/css/css_positioning.asp Here are some instructions on css positioning in w3school

z-index:1 This determines the display order of two layers together, z-index The default value is 0, which is suitable for use when there are many layers

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template