问题:在我调整浏览器大小之前,图片不会显示,或者每张图片只显示一小部分;每次重新加载页面时,结果都是随机的。重新加载页面 10 次,我可以获得 10 种不同的结果。
调整窗口大小后,页面将完全按照应有的外观显示,即使将页面调整回原始大小,它也会继续工作。
在一个非常简单的网页遇到问题后,
js小提琴在这里(工作得很好):
我发现我可以对页面源进行的一项更改是删除
<!DOCTYPE html>
没有其他更改可以解决问题,但删除该标签可以 100% 解决问题。为什么是这样??
HTML:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/style.css">
<title>Title</title>
<meta name="keywords">
<meta name="description" content="The GameMode Hub is a Minecraft Server Network bringing together all of Minecraft's best and brightest server owners to present the gaming community with the largest collection of Minecraft Servers in the world!">
<meta name="author" content="Jonathan Todd">
</head>
<body>
<div class="wrap">
<!-- begin wrap :: this will keep all of the stuff neat and in one place -->
<div class="login-screen bg-dirt">
<!-- begin login screen, background dirt :: sets up a background for the login and styles it with a dirt tile and holds all login elements -->
</div>
<!-- end login screen, background dirt -->
<div class="welcome-screen">
<!-- begin welcome screen :: this will hold the elements within the welcome screen, mainly just a title and the two moving wall pieces -->
<div class="wall-left">
<!-- begin wall left :: must I explain this? It opens and closes with the other wall -->
<img src="http://www.new.gamemode.org/images/wall_left.png">
</div>
<!-- end wall left -->
<div class="wall-right">
<!-- begin wall-right :: must I explain this? It opens and closes with the other wall -->
<img src="http://www.new.gamemode.org/images/wall_right.png">
</div>
<!-- end wall right -->
<img class="welcome-logo" src="http://www.new.gamemode.org/images/logo.png">
<img class="welcome-shadows" src="http://www.new.gamemode.org/images/shadows_fast.png">
</div>
<!-- end welcome screen -->
</div>
<!-- end wrap -->
</body>
</html>
CSS:
/* Style Setup */
body, div {
margin:0;
padding:0;
-webkit-perspective:6500;
}
table {
border-collapse:collapse;
border-spacing:0;
}
fieldset, img {
border:0;
}
address, caption, cite, code, dfn, th, var {
font-style:normal;
font-weight:normal;
}
caption, th {
text-align:left;
}
h1, h2, h3, h4, h5, h6 {
font-size:100%;
font-weight:normal;
}
q:before, q:after {
content:'';
}
abbr, acronym {
border:0;
}
.wrap, html {
width:100%;
margin:0px;
padding:0px;
height:100%;
overflow:hidden;
}
/* Style Start */
.bg-dirt {
}
.login-screen {
z-index:0;
}
.welcome-screen {
z-index:1;
width:100%;
height:100%;
}
.wall-left {
position:absolute;
z-index:2;
height:100%;
left:0px;
}
.wall-right {
position:absolute;
z-index:3;
height:100%;
right:0px;
}
.welcome-logo {
position:absolute;
z-index:4;
margin-left:auto;
margin-right:auto;
}
.welcome-shadows {
position:absolute;
z-index:5;
width:100%;
}