也许是出于无知,我很惊讶地发现自己在调用phpinfo()
时无法更改html页面的正文颜色。
进一步的调查使我认为这一定与错误 24095 (http://www.justskins.com/forums/24095-com-phpinfo-styles-25807.html) 有关。
换句话说,这将不起作用:
<html>
<head>
<title>My Page: info PHP</title>
<meta charset="UTF-8">
<style>
body { background-color: darkGray;}
#presentation
{
width:500px;
height: 140px;
text-align: center;
color: lightGray;
margin: auto;
margin-top: 40px;
background-color: darkGray;
}
</style>
</head>
<body>
<div id='presentation'>
<h2>Info about PHP</h2>
<p>
See hereunder the current settings for your server
</div>
<? echo phpinfo(); ?>
</body>
</html>
那么如何在调用phpinfo()
时更改页面正文颜色呢?
这段代码是基于css的一个相当简单的解决方法:
<html>
<head>
<title>My Page: info PHP</title>
<meta charset="UTF-8">
<style>
body { background-color: darkGray; margin: 0 0 0 0;}
#zPHP { background-color: darkGray; }
#presentation
{
width:500px;
height: 140px;
text-align: center;
color: lightGray;
margin: auto;
margin-top: -20px;
padding-top: 40px;
}
</style>
</head>
<body>
<div id='zPHP'>
<div id='presentation'>
<h2>Info about PHP</h2>
<p>
See hereunder the current settings for your server
</div>
<? echo phpinfo(); ?>
</div>
</body>
</html>
希望它能帮助一些人。