Php 在html中呈现空白-Drupal 7?
当我使用模块时,我遇到了一些问题。出现了一些空白Php 在html中呈现空白-Drupal 7?,php,html,drupal,drupal-7,Php,Html,Drupal,Drupal 7,当我使用模块时,我遇到了一些问题。出现了一些空白 $content=''; $vocab = vuagame_getVocByName("the_loai_game"); $terms = taxonomy_get_tree($vocab->vid); foreach ($terms as $term) { $content.="<div class='contentBox'>"; $content.="<div class='contentBoxHead
$content='';
$vocab = vuagame_getVocByName("the_loai_game");
$terms = taxonomy_get_tree($vocab->vid);
foreach ($terms as $term) {
$content.="<div class='contentBox'>";
$content.="<div class='contentBoxHeader'>";
$content.="<a href='/category/".$term->tid."'>".$term->name."</a>";
$content.="</div>";
$content.="<table class='gameTable' cellspacing='0' cellpadding='5'>";
$content.= views_embed_view('home', 'page', $term->tid);
$content.="</table>";
$content.="<div class='seemorelink'><a href='/category/".$term->tid."'>Xem thêm</a></div>";
$content.="</div><br/>";
}
return $content;
$content='';
$vocab=vuagame_getVocByName(“loai_游戏”);
$terms=taxonomy\u get\u tree($vocab->vid);
foreach($terms作为$term){
$content.=”;
$content.=”;
$content.=”;
$content.=”;
$content.=”;
$content.=视图\嵌入\视图('home','page',$term->tid);
$content.=”;
$content.=”;
$content.=“
”;
}
返回$content;
以下是inspect element的结果:
<div class="contentBox"><div class="contentBoxHeader"><a href="/category/23">18+</a></div>
"
"
<table class="gameTable" cellspacing="0" cellpadding="5"><tbody><tr>
"
"
有人能找到我的麻烦吗?非常感谢 首先,br标签现在不是标准。 这样调试, 1) 首先尝试不带循环的html。或者在第一个循环后中断循环。 如果仍然存在空白, 将href标记替换为 "<a href='lorum.html'>ispum </a>" “<a href='lorum.html'>ispum” 看看它是否消失了。。可能会出现不规则的标签打开/关闭 如果它仍然存在, 如果可能有一些错误的数据,请用虚拟文本替换所有数据对象。您所说的“出现了一些空白”是什么意思?你可以看到一些东西,但是下面有空白 如果是这种情况,您可以尝试将“clearfix”类添加到输出中,并将其添加到css文件中:
.clearfix:after {
content: "";
clear: both;
font-size: 0;
display: block;
height: 0;
visibility: hidden;
}
是的,这似乎是不必要的,这也可能导致问题。这似乎是一个编码问题。请确保您正在使用编码UTF-8保存.tpl文件 这将修复奇怪的空间