徽标图片未加载 - PHP [关闭]

徽标图片未加载 -  PHP [关闭]

问题描述:

I'm working on a template file and I came across something that's biting my head.

On the header.php file I have the following

<div id="logo">
<a href="index.php"><img src="images/logo.png" alt="MY COMPANY""/></a>
<p class="tagline">MY COMPANY</p>

However the logo.png file is not showing up. only the alt= text and the "tagline" show up.

  1. The .png file is in the images folder
  2. The css file is properly configured (at least to my knowledge)
  3. the header.php file is outside the 'images' folder so the image path should be ok.

this is my css code just for reference.

#logo {
float:left;
margin:22px 0 0 0;
}
#logo a {
    float:left;
    }
#logo .tagline {
    display:inline;
    float:left;
    margin:0;
    width:115px;
    line-height:14px;
    color:#aeaeae;
    margin:0 0 0 10px;
    padding-top:5px;
    font-family:Arial, Helvetica, sans-serif;
    }

Thanks for the help in advance.

我正在处理一个模板文件,我遇到了一些令我讨厌的东西。 p>

在header.php文件中,我有以下 p>

 &lt; div id =“logo”&gt; 
&lt; a href =“index.php”  &gt;&lt; img src =“images / logo.png”alt =“MY COMPANY”“/&gt;&lt; / a&gt; 
&lt; p class =”tagline“&gt; MY COMPANY&lt; / p&gt; 
  代码>  pre> 
 
 

p>

但是logo.png文件没有显示。只显示alt = text和“标语”。 p>

  1. .png文件位于images文件夹中 li>
  2. 正确配置了css文件(至少据我所知) li> \ n
  3. header.php文件位于'images'文件夹之外,因此图像路径应该没问题。 li> ol>

    这是我的css代码,仅供参考。 p>

      #logo {
    float:left; 
    margin:22px 0 0 0; 
    } 
     #loga a {
     float:left; 
    } 
      #logo .tagline {
     display:inline; 
     float:left; 
     margin:0; 
     width:115px; 
     line-height:14px; 
     color:#aeaeae; 
    m  argin:0 0 0 10px; 
     padding-top:5px; 
     font-family:Arial,Helvetica,sans-serif; 
    } 
      code>  pre> 
     
     

    谢谢 提前帮助。 p> div>

there is a mistake in your imgtag syntax, remove closing " at the end of alt attribute

<img src="images/logo.png" alt="MY COMPANY"/>

Can you try the relative path instead? Something like "/path of your web app/images/logo.png" . It might also be a file permission or misspelling.

I bit that your PHP is hosted on linux host, check file permissions of your image and its folder.

your extra " prevents the img tag from closing causing your problems (highlighted with [])

<a href="index.php"><img src="images/logo.png" alt="MY COMPANY"["]/></a>