<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Pure Css Popup</title> <style> * { box-sizing: border-box; } html, body { font-family: "Raleway", sans-serif; font-size: 16px; } @media screen and (max-width: 768px) { html, body { font-size: 12px; } } .container { background-color: #9191E9; display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; } .button { text-decoration: none; font-size: 0.875rem; font-weight: 300; text-transform: uppercase; display: inline-block; border-radius: 1.5rem; background-color: #fff; color: #9191E9; padding: 1rem 2rem; } .popup { display: flex; align-items: center; justify-content: center; position: fixed; width: 100vw; height: 100vh; bottom: 0; right: 0; background-color: rgba(0, 0, 0, 0.8); z-index: 2; visibility: hidden; opacity: 0; overflow: hiden; transition: 0.64s ease-in-out; } .popup-inner { position: relative; bottom: -100vw; right: -100vh; display: flex; align-items: center; max-width: 800px; max-height: 600px; width: 60%; height: 80%; background-color: #fff; transform: rotate(32deg); transition: 0.64s ease-in-out; } .popup__photo { display: flex; justify-content: flex-end; align-items: flex-end; width: 40%; height: 100%; overflow: hidden; } .popup__photo img { width: auto; height: 100%; } .popup__text { display: flex; flex-direction: column; justify-content: center; width: 60%; height: 100%; padding: 4rem; } .popup__text h1 { font-size: 2rem; font-weight: 600; margin-bottom: 2rem; text-transform: uppercase; color: #0A0A0A; } .popup__text p { font-size: 0.875rem; color: #686868; line-height: 1.5; } .popup:target { visibility: visible; opacity: 1; } .popup:target .popup-inner { bottom: 0; right: 0; transform: rotate(0); } .popup__close { position: absolute; right: -1rem; top: -1rem; width: 3rem; height: 3rem; font-size: 0.875rem; font-weight: 300; border-radius: 100%; background-color: #0A0A0A; z-index: 4; color: #fff; line-height: 3rem; text-align: center; cursor: pointer; text-decoration: none; } </style> </head> <body translate="no" > <div class="container"> <a class="button" href="#popup">Open Modal</a> <div class="popup" id="popup"> <div class="popup-inner"> <div class="popup__photo"> <img src="https://images.unsplash.com/photo-1515224526905-51c7d77c7bb8?ixlib=rb-0.3.5&s=9980646201037d28700d826b1bd096c4&auto=format&fit=crop&w=700&q=80" alt=""> </div> <div class="popup__text"> <h1>抓取异常对网站有哪些影响</h1> <p>对于大量内容无法正常抓取的网站,搜索引擎会认为网站存在用户体验上的缺陷,并降低对网站的评价,在抓取、索引、权重上都会受到一定程度的负面影响,最终影响到网站从百度获取的流量。 <br> 如果,对于有几千几万张网页的网站来说,百度一天抓几千次,一天只有几条抓取异常,我想那应该不受影响的,毕竟比例太低。</p> </div> <a class="popup__close" href="#">X</a> </div> </div> </div> </body> </html> <!-- 文章来源:10款纯CSS模态弹窗/模式窗口(modal popup) http://www.webkaka.com/tutorial/html/2021/1015185/ //-->
卡卡测速网
>
html技术
>
10款纯CSS模态弹窗/模式窗口(modal popup)
添加收藏
下载源代码
|
运行结果
demo.html
运行代码
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX