css浏览器原生dialog popup弹出框弹出层效果代码

代码语言:html

所属分类:弹出层

代码描述:css浏览器原生dialog popup弹出框弹出层效果代码,使用了dialog标签实现。

代码标签: css 浏览器 原生dialog popup 弹出框 弹出层

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
  
<style>
html {
  font-family: system-ui, sans-serif;
}

[popover]:popover-open {
  opacity: 1;
  transform: scale(1);
}

[popover] {
  /* Final state of the exit animation */
  opacity: 0;
  transform: scale(0) rotate(270deg);
  transition: opacity 0.7s, transform 0.7s, overlay 0.7s allow-discrete, display 0.7s allow-discrete;
}

/* Needs to be after the previous [popover]:popover-open rule
to take effect, as the specificity is the same */
@starting-style {
  [popover]:popover-open {
    opacity: 0;
    transform: scale(0) rotate(270deg);
  }
}
/* Transition for the popover's backdrop */
[popover]::backdrop {
  background-color: rgba(0, 0, 0, 0);
  transition: display 0.7s allow-discrete, overlay 0.7s allow-discrete, background-color 0.7s;
}

[popover]:popover-open::backdrop {
  background-color: rgba(0, 0, 0, 0.25);
}

@starting-style {
  [popover]:popover-open::backdrop {
    background-color: rgba(0, 0, 0, 0);
  }
}
[popover] {
  width: 50vw;
  height: 50vh;
  display: grid;
  place-content: center;
  font-size: 1.2rem;
  padding: 1rem;
  border: 1vmin solid;
  background-color: #ffe681;
  box-shadow: 1vmin 1vmin 0 0 color-mix(in lab, currentcolor 80%, #0000);
}
[popover] a {
  color: #5eb0e5;
  text-decoration: none;
}

button[popovertarget=popup] {
  appearance: none;
  border: 1px solid;
  background-color: #0000;
  box-shadow: 2px 2px 0 2px #000;
  cursor: pointer;
  transi.........完整代码请登录后点击上方下载按钮下载查看

网友评论0