php echo div 类不工作

标签 php css class html echo

<分区>


这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助 future 的读者。

关闭 9 年前

我正在尝试回显一个 div 类 <div class="Box">但没有工作。谁能帮忙?谢谢。

     echo '<div class="Box">

     echo Anchor(T('Edit My Account'), '/profile/edit', FALSE, array('class' => 'Popup EditAccountLink'));
     echo "<br />";
     echo Anchor(T('Change My Password'), '/profile/password', FALSE, array('class' => 'Popup PasswordLink'));
     echo "<br />";

     $Inbox = 'Inbox';
     $CountUnreadConversations = $Session->User->CountUnreadConversations;
     if (is_numeric($CountUnreadConversations) && $CountUnreadConversations > 0)
     $Inbox .= ''.$CountUnreadConversations.'';
     echo Anchor(T('Inbox'), '/messages/all', 'Inbox');

     </div>'

最佳答案

你的第一行和最后一行是错误的,缺少正确的引号,最后一行也有回显。应该是:

echo '<div class="Box">';

 .... rest of code here...

echo '</div>';

关于php echo div 类不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21738542/

上一篇:css - img alt 更改图像尺寸

下一篇:html - 元素有时只显示

相关文章:

php - 如何在 WordPress 小部件中保存复选框数组?

c# 接收位于文档目录中的文本文件,然后使用 API 发送文本文件

javascript - Bootstrap -btn 组,数据切换 ="buttons": how to select a button with JS and deselect all others?

html - 如何垂直对齐水平菜单中的元素?

php - 常量表达式包含无效操作

c# - 不是按名称而是按类型指定接口(interface)成员

php - "Blog Post"从 Mysql 数据库显示图像

css - iPad 在我不想要的时候拉伸(stretch)我的内容以适合屏幕

html - 为什么一些一次性使用的元素在 CSS 中是 Class 而不是 ID?

PHP 函数 `get_object_vars` 没有从继承的方法中获取私有(private)变量