html - 登录后隐藏 margin-top

标签 html css smf smf-forum

我有如下一行代码:

<div align="center" style="margin-bottom: 5px; margin-top: 35px;">
<!-- AD CODE HERE -->
</div>

请关注我的网站:http://www.electronicsforum.in/

当它是 guest 用户时,它会显示一条弹出消息“请登录/注册”。我对此没有意见。
但是登录后我想隐藏 divmargin-top

最佳答案

下面的代码修复了 www.electronicsforum.in 上的问题

global $context;
if ($context['user']['is_logged']) {
echo'<div align="center" style="margin-bottom:5px; margin-top: 5px;"> ---Ad Code Here 1-- </div>';
}
else
{
echo'<div align="center" style="margin-bottom: 5px; margin-top: 35px;"> ---Ad Code Here else-- </div>';
}

关于html - 登录后隐藏 margin-top,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22968208/

相关文章:

java - 推荐用于视频编码的库和编程语言

php - MySQL 计算所有 child ,不管有多少

php - HTML 表单/PHP : select with option value = array

javascript - Thymeleaf 将数据从 html id 传递到 thymeleaf 变量

javascript - 在 bxslider 幻灯片中将图像居中的问题

html - 我可以在 HTML 上的 GUI 标签内使用 DIV 吗?

html - 相对父级动态定位,不占用原有空间

javascript - 有没有办法在 Chrome 中的选择选项元素上添加事件?

javascript - 确定哪个 JavaScript 文件应用了样式?