• I am trying to install different modal on my website. I tried using plug or using CSS. Both are not working as I want them to:
    – for the plugin it doesn’t work at all, nothing happen and I tried different plug in so I think the problem is from the Theme
    – using the CSS, when we click on the link the open the modal, the modal go to the top of the page and didn’t go back when we close it.

    I would like to use CSS, I think it is easier. Do you have any idea about how I can do?

    My website where there is the modals: https://uberis.duponddupont.com/about-us.

    My CSS code:

    /* Fenêtre settings MODAL */
    @-webkit-keyframes example {
    	from {
    		top: -100px;
    		opacity: 0;
    	}
    
    	to {
    		top: 0;
    		opacity: 1;
    	}
    }
    
    /* Add animation (Standard syntax) */
    @keyframes example {
    	from {
    		top: -100px;
    		opacity: 0;
    	}
    
    	to {
    		top: 0;
    		opacity: 1;
    	}
    }
    
    /* The modal's background */
    .modal {
    	display: none;
    	position: absolute;
    	left: 0;
    	top: 0;
    	width: 100%;
    	height: 100%;
    	overflow: auto;
    	background-color: rgb(0,0,0);
    	background-color: rgba(0,0,0,0.4);
    }
    
    /* Display the modal when targeted */
    .modal:target {
    	display: table;
    	position: absolute;
    }
    
    /* The modal box */
    .modal-dialog {
    	display: table-cell;
    	vertical-align: middle;
    	text-align: auto;
    	width: 70%;
    }
    
    /* The modal's content */
    .modal-dialog .modal-content {
    	margin: auto;
    	background-color: #f9f9f9;
    	position: relative;
    	padding: 0;
    	outline: 0;
    	border: 1px #777 solid;
    	width: 70%;
    	box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    /* Add animation */
    	-webkit-animation-name: example;
    /* Chrome, Safari, Opera */
    	-webkit-animation-duration: .5s;
    /* Chrome, Safari, Opera */
    	animation-name: example;
    	animation-duration: .5s;
    }
    
    .header {
    	color: black;
    }
    
    /* The button used to close the modal */
    .closebtn {
    	text-decoration: none;
    	font-size: 35px;
    	font-weight: bold;
    	color: grey;
    	text-shadow: 1px 2px 3px rgba(0,0,0,0.5);
    }
    
    .closebtn:hover,
    .closebtn:focus {
    	color: #000;
    	text-decoration: none;
    	cursor: pointer;
    }
    
    .container {
    	padding: 2px 16px;
    	width: auto;
    }
    
    header.container {
    	background: #f3f3f3;
    }

  • The topic ‘Problem with modal’ is closed to new replies.