Remove spaces not visible in your code

I have a weird blank space at the top of one of my divs.

This html:

<!-- ### Bottom content container ### -->
<div class="bottom_content">
    <div class="messages"><!-- include problems.php - down devices -->
        <?php include "problems.php";?>
    </div>
</div>
<!-- ### End bottom content container ### -->

      

When I view the output, I notice that messages

there are two after the comment inside the class ""

. Like this:

<div class="messages"><!-- include problems.php - down devices -->
" "
    <?php include "problems.php";?>
</div>

      

This is how the messages

css is:

.messages {
  display:block;
  width: auto;
  padding: 10px;
  padding-top: -10px; /* Added this to try to remove blank space in top of div */
  background: rgb(255, 255, 255); /* The Fallback */
  background: rgba(255, 255, 255, 0.5);
  -moz-border-radius: 10px;
  border-radius: 10px;
  border: #ffffff 1px solid;
}

      

This creates a blank line at the top of the div. How can I remove this? I cannot find these two ""

anywhere in the code, nor can I find spaces.

EDIT: Here's the problem. Php:

<center><div id="chkerror"></div></center>

      

This is automatically populated with content from a separate php file every 30 seconds using the following jquery:

// <![CDATA[
$(document).ready(function() {
$.ajaxSetup({ cache: false }); // This part addresses an IE bug.  without it, IE will only load the first number and will never refresh
setInterval(function() {
 $('#chkerror').load('chkIncludes.php');
}, 30000); // the "30000" here refers to the time to refresh the div.  it is in milliseconds.
});
// ]]>

      

And here is the content of chkIncludes.php:

<?php include "chkLoc1.php";?>
<?php include "chkLoc2.php";?>

      

chkLoc1.php and chkLoc2.php contains:

<?php
  $host  = "10.10.10.1";
  $loc = ("Location 1");
  $output = array();
        exec("ping -n 1 $host 2>&1", $output);
      //you can use  print_r($output)  to view the output result
      if (count($output) > 7) {
        $output = null;
        $status = ("up");
        $formattedstatus = ("<font color='green'><b>$status</b></font>");
        }
        else {
        $output = null;
        $status = ("down");
        $formattedstatus = ("<font color='red'><b>$status</b></font>");
        };
    echo ("<div class='$status'><a href='#18/58.99940/5.62324' class='locLink' title='Click to show'><b>$loc</b> <i>(IP: $host)</i> is $formattedstatus</a></div>");

?>

      

+3


source to share


1 answer


Make sure the file is problems.php

encoded without BOM (byte order mark).



If you are using Notepad ++ you can achieve this via: Encoding> Encoding in UTF-8 without BOM

+2


source







All Articles