| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <title>简单的模态框(Modal)</title>
- <style>
- .modal:before {
- content: "";
- display: none;
- background: rgba(0, 0, 0, 0.6);
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 10;
- }
- .modal:target:before {
- display: block;
- }
- .modal:target .modal-dialog {
- -webkit-transform: translate(0, 0);
- -ms-transform: translate(0, 0);
- transform: translate(0, 0);
- top: 20%;
- }
- .modal-dialog {
- background: #fefefe;
- border: #333 solid 1px;
- border-radius: 5px;
- margin-left: -120px;
- position: fixed;
- left: 35%;
- z-index: 11;
- width: 800px;
- -webkit-transform: translate(0, -500%);
- -ms-transform: translate(0, -500%);
- transform: translate(0, -500%);
- -webkit-transition: -webkit-transform 0.3s ease-out;
- -moz-transition: -moz-transform 0.3s ease-out;
- -o-transition: -o-transform 0.3s ease-out;
- transition: transform 0.3s ease-out;
- }
- .modal-body {
- padding: 10px 20px;
- }
- .modal-header {
- border-bottom: #eee solid 1px;
- }
- .modal-header h2 {
- font-size: 20px;
- margin-left: 30px;
- }
- .box-shadow-dark{
- box-shadow: 0 0 10px 5px rgba(0,0,0,0.9);
- z-index:100;
- position:relative;
- }
- .modal-body-div{
- width: 30%;
- display: inline-block;
- }
- .modal-body-item{
- margin: 10px;
- border: 3px solid red;
- border-radius: 5px;
- height:100px;
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column
- }
- .modal-body-item-text{
- margin-left:10%;
- width: 80%;
- }
- .modal-footer {
- padding: 10px 20px;
- }
- .modal-footer {
- border-top: #eee solid 1px;
- text-align: right;
- }
- .btn {
- background: #428bca;
- border: #357ebd solid 1px;
- border-radius: 3px;
- color: #fff;
- display: inline-block;
- font-size: 14px;
- padding: 8px 15px;
- text-decoration: none;
- text-align: center;
- min-width: 60px;
- position: relative;
- transition: color .1s ease;
- }
- .btn:hover {
- background: #357ebd;
- }
- </style>
- </head>
- <body>
- <a href="#modal-one">111</a>
- <div class="modal" id="modal-one" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-header">
- <h2>选择仓库</h2>
- </div>
- <div class="modal-body">
- <div class="modal-body-div" data-id="1">
- <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
- </div>
- <div class="modal-body-div">
- <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
- </div>
- <div class="modal-body-div">
- <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
- </div>
- <div class="modal-body-div">
- <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
- </div>
- </div>
- <div class="modal-footer">
- <a href="#" class="btn" onclick="test()">确 定</a>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- function test() {
- }
- </script>
- </body>
- </html>
|