HTML和Php图像不在线显示,但在本地主机中显示


Html and Php image not showing online but showing in localhost

图像的文件位置是正确的,它显示在本地主机上,但不在线,我如何才能让它工作?

我尝试将图像从 png 更改为 jpg,并使用不同的图像并更改文件位置,然后在代码上更新它,但它仍然不显示图像

<!DOCTYPE HTML>
<html>
<head>
<title>KMS</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="UTF-8">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
</head>
<body id="wrapper">
<div id="header">
<!--Logo-->
<div id="Logo">
</div>
<!--Logo-->
<!--Menu Buttons-->
<?php include 'menu.php';?>
<!--Menu Buttons-->
</div>

<div id="hContent">
<!--Frames--====================================================================-->
<div id="hFrames">
<!--Information go below-->
<div id="infoCon1">
<img id="kms_img" src="Images/Kmsproductsinformation.jpg" style="width:850px;"/>
<b />
<b />
</div>
<!--Information end-->
</div>


</div>
</div>

<!--
footer
-->

</body>
</html>

尝试<img id="kms_img" src="images/kmsproductsinformation.jpg" style="width:850px;"/>并确保images目录和kmsproductsinformation.jpg文件为小写。

你的 DIV 发生了一些有趣的事情。在文件末尾,您有两个额外的关闭DIV标签()-我将首先修复它们。

话虽如此,它是否是本地主机,或者它是 jpg 还是 png 也无关紧要,但如果您将其设置为非 100% 宽度,PNG 会更好。

尝试一些基本的东西,没有所有的 DIVS 或你的菜单.php文件,看看它是否有效。

<!DOCTYPE HTML>
<html>
<head>
<title>KMS</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="UTF-8">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script>
</head>
<body id="wrapper">
<img id="kms_img" src="Images/Kmsproductsinformation.jpg" />
</body>
</html>