html Modal样式//来源http://js.jirengu.com/dituyefika

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html Modal样式//来源http://js.jirengu.com/dituyefika相关的知识,希望对你有一定的参考价值。

.content {
  width: 600px;
  margin: 0 auto;
}

.modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.4);
}

.modal .card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 600px;
  background-color: #fff;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.card header,
.card footer
{
  background-color: #22d0b2;
  color: #fff;
  padding: 1px 16px;
}

.card .close {
  float: right;
  margin-top: 16px;
  font-size: 20px;
  cursor: pointer;
}

.card section {
  padding: 16px;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
<style id="jsbin-css">
.content {
  width: 600px;
  margin: 0 auto;
}

.modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.4);
}

.modal .card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 600px;
  background-color: #fff;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.card header,
.card footer
{
  background-color: #22d0b2;
  color: #fff;
  padding: 1px 16px;
}

.card .close {
  float: right;
  margin-top: 16px;
  font-size: 20px;
  cursor: pointer;
}

.card section {
  padding: 16px;
}
</style>
</head>
<body>
<div class="content">
  <h1>内容</h1>
  <h1>内容</h1>
  <h1>内容</h1>
  <div class="modal">
    <div class="card">
      <header>
        <span class="close">×</span>
        <h3>Title</h3>
      </header>
      <section>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
      </section>
      <footer>
        <p>Footer</p>
      </footer>
    </div>
  </div>
</div>


<script id="jsbin-source-css" type="text/css">.content {
  width: 600px;
  margin: 0 auto;
}

.modal {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.4);
}

.modal .card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 600px;
  background-color: #fff;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.card header,
.card footer
{
  background-color: #22d0b2;
  color: #fff;
  padding: 1px 16px;
}

.card .close {
  float: right;
  margin-top: 16px;
  font-size: 20px;
  cursor: pointer;
}

.card section {
  padding: 16px;
}</script>
</body>
</html>

以上是关于html Modal样式//来源http://js.jirengu.com/dituyefika的主要内容,如果未能解决你的问题,请参考以下文章

html 菜单//来源http://js.jirengu.com/hirasuxuva

使用 react-modal 更改模式的样式

bootstrap 4 modal-backdrop 样式(特定模态)

html 企业首页//来源http://js.jirengu.com/xolureheqo

html 表单效果//来源http://js.jirengu.com/qacoxoleji

html alert效果//来源http://js.jirengu.com/tulahabene