1

当我上传到服务器时,2 div 没有显示,但它们在我的本地主机(wampp)上显示正常。任何人都可以就为什么会这样提供帮助吗?有问题的div是'footer'和'poster'

html

<div class="wrapper">
 <?php include '../inc/header.php';?>
    <div id="info">
       <div id="what">
           <span class="h1">WHAT IS IT?</span>
        </div>
        <?php 
           include '../inc/connect.php';
       $data = mysql_query("SELECT info FROM mainhomepagecontent")
           or die(mysql_error());          
           while($info = mysql_fetch_array( $data )) {
          echo "<span class='text'>";
      echo nl2br($info['info']);
          echo "</span>";
            } 
         ?> 
      </div>         
  <?php include '../inc/poster.php';?>
  <?php include '../inc/footer.php';?>
   </div>

页脚文件

<?php
$output = "<div class='footer'>";
$output .= "<div class='wsd'>";
$output .= "Site Developed by Webslinger Development";
$output .= "</div>";
$output .= "<div class='ngcopyright'>";
$output .= "All Rights Reserved 2013 &copy Needle Gangsta's ";
$output .= "</div>";
$output .= "</div>";
echo $output;
?>

海报文件

<?php
$output ='<div class="poster">';
$output .='<div class="posterfixed">';
$output .='<div class="eighteenlogo">';
$output .= '<img src="../images/siteimages/18logo.png" />';
$output .= '</div>';
$output .='<div id="wherewhen">';
$output .='<div id="when">';
$output .='<span class="h2">WHEN IS IT?</span><br /> <span class="text2">9TH/10TH            
FEBUARY 2014</span>';
$output .='</div>';
$output .='<div id="where">';
$output .='<span class="h2">WHERE IS IT?</span><br /> <span class="text2">Holiday Inn 
(EAST)<br />
London Rd<br />
Newport Pagnell<br />
Milton Keynes<br /> MK16 0JA</span>';
$output .='</div>';
$output .='</div>';
$output .='</div>';
echo $output;
?>

和CSS

.header{
float:left;
margin:15px 0 0 0;
width:280px;
min-height:382px;
}

.headerfixed{
position:fixed;
width:280px;
min-height:382px;
background-image:url(../images/siteimages/logo.png);
background-repeat:no-repeat;
}

.wrapper{
width:1280px;
position:relative;
border-left:1px solid #ffffff;
border-right:1px solid #ffffff;
margin: 0 auto 0 auto;
background:#000000;
overflow:hidden;
}

/*sets the left side div*/
.poster{
position:absolute;
top:20px;
right:0;
width:390px;
min-height:512px;
}

.posterfixed{
position:fixed;
width:390px;
min-height:512px;
background-image:url(../images/siteimages/background.png);
}

.eighteenlogo{
position:absolute;
right:10px;
top:450px;
}



/*sets the footer*/
.footer{
float:left;
min-width:1280px;
overflow:hidden;
}

感谢观看........

4

1 回答 1

-1

您可以使用Heardoc ( wikipedia ) 而不是连接字符串。我认为更容易看到缩进,它可以帮助您发现未闭合的标签:

$output = <<<EOF
<div class="footer">
  <div class="wsd">
    Site Developed by Webslinger Development
  </div>
  <div class="ngcopyright">
   All Rights Reserved 2013 &copy; Needle Gangsta's
  </div>
</div>
EOF;

echo $output;

标识符中的任何内容EOF(这可以是您想要的任何内容,请参阅参考资料。)不会忽略任何空格。

于 2013-06-20T21:33:02.283 回答