所以我有一个带阴影的盒子,但当我关闭盒子并隐藏时,会留下不同的阴影。我无法解决这个问题,而且无法分辨它的来源。我附上了我的代码,所有代码都在文件和文件夹中。我认为这是一个HTML错误,但它也可能是一个CSS错误。
可能无法在谷歌浏览器以外的浏览器中运行此功能。
function popupClose() {
$('#popup').hide();
}
$(function() {
$('#content').text(myFunction());
});
// Above code was in a file called browser_detection in a folder named js
function validate() {
var x = $('#in').val();
if (navigator.userAgent.indexOf("Chrome") != -1) {
$('.popup').css("display", "none");
} else {
$('.popup').load('html/popuphtml.html');
}
}
window.onload = validate;
// Above code was in normal index.html

.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
transition: opacity 500ms;
visibility: visible;
transition: all 600ms ease-in-out;
}
.overlay:target {
visibility: visible;
opacity: 1;
}
.popup {
-moz-margin: 70px auto;
-moz-padding: 15px;
background: #eee;
border-radius: 8px;
-moz-width: 30%;
text-align: center;
box-shadow: 0 0 90px 80px #eee;
z-index: 1;
position: relative;
transition: all 600ms ease-in-out;
}
.popup h2 {
margin-top: 0;
color: #333;
font-family: Tahoma, Arial, sans-serif;
text-align: center;
}
.popup .close {
position: absolute;
top: 10px;
right: 20px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #555;
}
.popup .close:hover {
color: #B00B0B;
text-shadow: 0 0 3px #B00B0B;
}
.popup .content {
max-height: 30%;
overflow: auto;
text-align: center;
}
@media screen and (max-width: 700px) {
.box {
width: 70%;
}
.popup {
width: 70%;
}
}
/* Above code was in browser_popup.css in css folder */

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="popup">
<h3>Loading...</h3>
</div>
<!-- Above code was in the normal index.html -->
<div id="popup" class="overlay">
<div class="popup">
<h3>Your browser at the moment is not supported for this website. Please use Chrome.</h3>
<a class="close" href="javascript:popupClose();">×</a>
</div>
</div>
<!-- Above code was in a folder called popup.html in a folder called html -->
&#13;
答案 0 :(得分:1)
我认为你在谈论.popup div shadow
.popup类有两件事,第一件是
background-color:#eee;
第二个是盒子阴影
box-shadow: 0 0 90px 80px #eee;
请从
中删除您不想要的任何内容由于