要解决此问题,请添加以下 CSS 规则:
html, body {
margin: 0;
padding: 0;
min-height: 100%;
}
默认情况下,页面有一个愚蠢的上边距,所以这会导致空白,这个 CSS 代码会重置它。
这是我所做的:
<html>
<head>
<title>NostalgiaRP LS</title>
<style>
html, body {
margin: 0;
padding: 0;
min-height: 100%;
}
</style>
</head>
<body>
<script type="text/javascript">
<!--Put keywords in here to display when loading.-->
keywords =
[
"Hacking Razley.",
"Getting your credit card information.",
"ED is coding your stuff!",
"Downloading a bunch of crap.",
"Demoting admins.",
"Fixing server bugs.",
"Braking the game.",
"Banning minges.",
"Drawing ponies!:D.",
"Checking your Steam ID.",
"Removing System 32.",
"Rehashing the MD5 algorithm.",
"Bathing Father Grigori.",
"Decrypting your steam account password.",
"Re installing Garry's Mod.",
"Killing Alyx.",
"Reloading guns.",
"Enter a useless message here!",
"Asking for you to become an admin.",
"Eating Watermelons.",
"RDM.",
"Fixing Source Engine.",
"Drawing on walls.",
"Taming Physics.",
"Drinking Vodka...",
"Sleeping.",
"Fixing Gman's suit.",
"Watching stuff and things...",
"Reducing your lifespan.",
"Joining the server.",
"Delaying Episode 3.",
"Uploading virus.",
"......"
]
var bCanChangeStatus = true;
function ChangeText ( ) {
if ( bCanChangeStatus )
{
var keyword = keywords[ Math.floor( Math.random() * keywords.length ) ]
document.getElementById( "loadingtext" ).innerHTML = keyword;
}
setTimeout( "ChangeText()", 2500 );
}
ChangeText();
var iFilesNeeded = 0;
var iFilesTotal = 0;
var bDownloadingFile = false;
function SetFilesNeeded( iNeeded )
{
iFilesNeeded = iNeeded;
RefreshFileBox();
}
function SetFilesTotal( iTotal )
{
iFilesTotal = iTotal;
RefreshFileBox();
}
function DownloadingFile( filename )
{
if ( bDownloadingFile )
{
iFilesNeeded = iFilesNeeded - 1;
RefreshFileBox();
}
document.getElementById( "loadingtext" ).innerHTML = "Downloading " + filename;
bCanChangeStatus = false;
setTimeout( "bCanChangeStatus = true;", 1000 );
bDownloadingFile = true;
}
function SetStatusChanged( status )
{
if ( bDownloadingFile )
{
iFilesNeeded = iFilesNeeded - 1;
bDownloadingFile = false;
RefreshFileBox();
}
document.getElementById( "loadingtext" ).innerHTML = status;
bCanChangeStatus = false;
setTimeout( "bCanChangeStatus = true;", 1000 );
}
function RefreshFileBox()
{
document.getElementById( "files" ).innerHTML = "<img src='/images/loadingscreen/download.png' style='position: relative; top: 7px;'> " + iFilesNeeded + " downloads remaining";
if ( iFilesTotal > 0 )
document.getElementById( "files" ).style.visibility = 'visible';
else
document.getElementById( "files" ).style.visibility = 'hidden';
}
RefreshFileBox();
</script>
<iframe width="0%" height="0" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/16687438&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe>
<center>
<div style="position: absolute;">
<!-- Put the image URL here!!-->
<img src="http://oi58.tinypic.com/2wmou89.jpg" style="height: 100%; max-width:100%; max-height:100%;" alt="">
<div id="loadingtext" style="position:absolute; top:50%; left:50%; color: #666; font-family: Arial; font-size: 12px; margin-top:-6px; width:128px; margin-left:-64px; font-weight: bold;">Loading Text..</div>
</div>
</div>
</center>
<div style='-webkit-box-reflect: below -120px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.1, transparent), to(rgba(255, 255, 255, 1.0))); position: absolute; top: 90%; right: 0; bottom: 0; left: 5%; height: 100px; overflow: show; font-family: Arial; font-size: 24px; font-weight: bold; color: #888' id='files'>
</div>
</div>
</body>
</html>
我得到一个适合整个屏幕的图像。