0
嗨,我想知道如果你能帮我一个问题,我的聪明的PHP代码将无法正常工作。问题是包含本节中所有代码的锚定标记在输出到网页时并不实际包围它。聪明的PHP锚链接不工作
<a href="mylink"> //the link that does not actually work/surround the code below when outputed
<div class="row" {if $smarty.section.pm_loop.last}style="border:none;"{/if}>
<div class="f-right" style="padding-right: 35px">
<a href='UserMessagesNew.php?pm_id={$pms[pm_loop].pm_id}'>{$Application659}</a><br/>
<a href='UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}&task=delete'>{$Application660}</a><br/>
<input type='checkbox' name='message_{$pms[pm_loop].pm_id}' value='1' style="margin:0; height:15px; width:15px;"/>
</div>
<a class="f-left" href="UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}"><img src="{$pms[pm_loop].pm_user->user_photo('./images/nophoto.gif')}" class='img' width="92px" alt="{$pms[pm_loop].pm_user->user_info.user_username} {$Application500}"></a>
<a href="#" class="msg-info-c">
<div class="msg-user-re"><b><a href="UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}">{$pms[pm_loop].pm_user->user_info.user_username}</a></b></div>
<a href="UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}"><div class="msg-datet">{$datetime->cdate("`$setting.setting_timeformat` `$setting.setting_dateformat`", $datetime->timezone($pms[pm_loop].pm_date, $global_timezone))}</div></a>
<a href="UserMessagesView.php?pm_id={$pms[pm_loop].pm_id}"><div class="user-msg-c">{$pms[pm_loop].pm_body|truncate:100|choptext:75:"<br>"}</div></a>
</a>
</div>
</a>
输出看起来是这样的:
<a href="mylink"></a>
<div class="row">
rest of content inside here
</div>
虽然您可以将块元素放置在HTML5的“a”中,但您可以_not_ __nest__'a'元素。 – CBroe
有没有解决这个问题的方法?因为它让我很困惑。 – andrew196
_what_ ...的解决方案? – CBroe