我有一些类似于您在下面看到的脚本:
#header2 {
align:center;
text-align:center;
font-size: 24px;
color:red;
}
#column {
width:100%;
}
.Lcol1 {
float:left;
width:16.5%;
}
.Lcol2 {
float:left;
position: relative;
width:16.5%;
}
.Lcol3 {
float:left;
position: relative;
width:16.5%;
}
.Lcol4 {
float:left;
position: relative;
width:16.5%;
}
.Lcol5 {
float:left;
position: relative;
width:16.5%;
}
.Lcol6 {
float:left;
position: relative;
width:
}
<div id="columns">
<span class="col1">
<?php
$i=1;
while ($i<$other) {
echo "text1";
}
?>
</span>
<span class="col2">
<?php
$i=1;
while ($i<2) {
echo "text2";
}
?>
</span>
<span class="col3">
<?php
$i=1;
while ($i<2) {
echo "text3";
}
?>
</span>
<span class="col4">
<?php
$i=1;
while ($i<2) {
echo "text4";
}
?>
</span>
<span class="col5">
<?php
$i=1;
while ($i<2) {
echo "text5";
}
?>
</span>
<span class="col6">
<?php
$i=1;
while ($i<2) {
echo "text6";
}
?>
</span>
</div>
<div id="header2">
header2
</div>`enter code here`
问题是“header2”仍在列中打印。即使我一次删除一列,标题仍在列中打印?为什么?如果没有 PHP 代码,它可以正常工作,但我需要 PHP 来回显数据。为什么 PHP 会在这里弄乱 html?