duandianwen1723
2012-11-12 18:32 阅读 27
已采纳

徽标图片未加载 - 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.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • 已采纳
    dongshuo1856 dongshuo1856 2012-11-12 18:53

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

    <img src="images/logo.png" alt="MY COMPANY"/>
    
    点赞 评论 复制链接分享
  • doumu8911 doumu8911 2012-11-12 18:39

    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.

    点赞 评论 复制链接分享
  • dongsuichi6529 dongsuichi6529 2012-11-12 18:39

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

    点赞 评论 复制链接分享
  • dongmeiran609914 dongmeiran609914 2012-11-12 18:42

    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>
    
    点赞 评论 复制链接分享

相关推荐