简体   繁体   中英

PHP Include Won't Show in Firefox

I have a PHP include placed into my page which is meant to call a .php extension with 2 images inside of a DIV.

Unfortunately it is showing up in Chrome and IE - but not Firefox. In Firefox it appears as nothing but 2 blue hyperlinks. I'm guessing the issue must be somewhere in my CSS(?) but I'll let you guys be the judge, because I'm out of ideas.

The main page :

<!-- ADVERTISING BANNER BEGINS -->
  <?php include('banner.php'); ?>
<!-- ADVERTISING BANNER ENDS -->

Which is calling :

<link href="css/railProductStyles.css" rel="stylesheet" type="text/css" />

<!-- ADVERTISING BANNER BEGINS -->
<div id="advertisingbanner">
  <a href="http://rsiweb.org/trade_shows/rsicma2014/" alt="">
    <img src="images\shelf-banner-left.png" alt="RSI/CMA 2014" />
  </a>
  <a href="http://www.innotrans.de/en/" alt="">
    <img src="images\shelf-banner-right.png" alt="" />
  </a>
</div>
<!-- ADVERTISING BANNER ENDS -->

Which is using the CSS :

/* ADVERTISING BANNER */
#advertisingbanner {
  width: 890px;
  float: left;
  margin-right: 55px;
  margin-left: 55px;
}

Put the style calling on header and leave the rest of the code on your php file. Also, I recommend you to use class instead id on that div. Also 2: switch the slash on your image url path such as "images/shelf-banner-left.png"

use img src as

<img src="images/shelf-banner-right.png" alt="" />

instead of

<img src="images\shelf-banner-right.png" alt="" />

Check the filename:

images\shelf-banner-left.png 

\\ is not valid, however some browsers support this, you should always use / instead. As far as I know, only firefox has problems with it though.

Just to make clear, Windows uses these kind of slashes in their filesystem ( \\ ) While Unix based OS's use / instead, web URL's should always be a forward slash.

You may want to disable your adblock plugin and see if it solves your problem. I had similar experience once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM