简体   繁体   中英

How to show modal / panel in overlay HTML - CSS

I want to show this panel or modal in html / css but i cant show it because i have

<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">

and when i remove that link the modal will show but when it is there the modal does not show.

PS I cannot remove that link because all of my design will be removed or will not be visible so how can i show that modal without removing that link here is my css

style

      <style type="text/css">

body {
    /* general styles */
    padding: 30px;
    font-family: 'Open Sans', sans-serif;

}

/* overlay styles, all needed */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10;
}

/* just some content with arbitrary styles for explanation purposes */
.modal {
    width: 300px;
    height: 200px;
    line-height: 200px;
    position: fixed;
    top: 50%; 
    left: 50%;
    margin-top: -100px;
    margin-left: -150px;
    background-color: #f1c40f;
    border-radius: 5px;
    text-align: center;
    z-index: 11; /* 1px higher than the overlay layer */
}

.content {
    margin: 30px;
}

h1 {
    font-family: 'Federo', sans-serif;
}
  </style>

my div

     <div class="overlay"></div>
  <div class="modal" id="modal"><?php echo $row['id']; ?> <?php echo $row['additional_info']; ?></div>

This doesn't show the dialog because the modal class is also used by Bootstrap.

If you change the line <div class="modal" id="modal"> to <div class="mymodal" id="modal"> you will see that it now appears. Be sure to also update your class name in your css as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM