我有一个问题,我有一个HTML问题,我不知道我是否使用最好的方法,所以这里是我的问题: Everthing被确定:http://screencast.com/t/uJmffaxE
如果我有更多的空间,在这里开始的问题:http://screencast.com/t/1z1GRhOLK
这里是我的代码:什么是从我的PHP循环输出正确的HTML的最佳方法
<div id="wrap-categories" class="clearfix">
<?php if($this->categories !== false): ?>
<ul>
<?php foreach($this->categories as $category):?>
<li>
<strong><?=$category['name']?></strong><br />
<?php if($this->artistsHelper($category['id']) !== false): ?>
<?php foreach($this->artistsHelper($category['id']) as $artist): ?>
<p><?=$artist['name']?></p>
<?php endforeach; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
这里是标记的样子,当产生:
<div id="wrap-categories" class="clearfix">
<ul>
<li>
<strong>Dj's</strong><br />
<p>Big fuckin'artists</p>
<p>asddssdadsasda</p>
<p>Gigle bossu</p>
</li>
<li>
<strong>Make up</strong><br />
<p>Cool</p>
</li>
<li>
<strong>Mamam</strong><br />
</li>
<li>
<strong>Tata</strong><br />
</li>
<li>
<strong>Dawaj</strong><br />
</li>
<li>
<strong>Sexy</strong><br />
</li>
<li>
<strong>Bitch</strong><br />
</li>
<li>
<strong>Armin</strong><br />
</li>
<li>
<strong>Lol</strong><br />
</li>
<li>
<strong>Gogu</strong><br />
</li>
<li>
<strong>Penal</strong><br />
</li>
<li>
<strong>Asasin</strong><br />
</li>
</ul>
</div>
CSS的
#wrap-categories ul li{
float:left;
margin-right:10px;
}
任何帮助,请?
您的问题是标记在所有空格中显示很大? – ChaosPandion 2009-08-26 01:11:30
http://screencast.com/t/1z1GRhOLK在这里,类别(强标题)应该在第一类... – Uffo 2009-08-26 01:20:03
如果您要显示表格数据,请使用表格。 – Sampson 2009-08-26 01:22:56