当我上传到服务器时,没有显示2个Divs,但是在我的localhost(wampp)上显示为ok。
谁能为您提供帮助,为什么会这样?
有问题的div是“页脚”和“海报”

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;
}


谢谢你的看........

最佳答案

您可以使用Heardocwikipedia)代替串联字符串。我认为更容易看到缩进,并且可以帮助您发现未封闭的标签:



$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标识符内的任何内容(可以是您想要的任何内容,请参阅参考资料。)都不会忽略任何空格。

关于css - 将Divs上传到服务器时不显示,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17223907/

10-17 02:58