【发布时间】:2014-04-10 16:59:02
【问题描述】:
我是 CSS 新手,所以还是有点摸不着头脑......
我正在尝试在我的开发website底部添加一行图像
这适用于桌面浏览器,但我想在移动设备上隐藏除 Trustwave 徽标之外的所有内容。
我的主题是响应式的,以下代码在 jFiddle 中运行良好,但在我的网站上却不行。请有人指出我遗漏了什么吗?
我知道我需要将内联样式移到 CSS 文件中,但首先试图找出 display:none 无法正常工作的原因。
HTML:
<div id="ft">
<div class="ftI">
<div class="ftT">
<?php echo $this->getChildHtml('newsletter') ?>
<?php echo $this->getChildHtml('cms_footer_links') ?>
</div>
<div class="ftB">
<span class="copr"><?php echo $this->getCopyright() ?></span>
<?php echo $this->getChildHtml('footer_links') ?>
</div>
</div>
<?php /** ADD LOGOS TO FOOTER */ ?>
<div class="ftLogos" style="width:80%; height:56px; margin:0 auto;">
<div class="ftFb" style="float:left; width:20%; text-align:center; margin:0 auto;"><img src="<?php echo $this->getSkinUrl() ?>images/logos/footer-facebook.png" alt="Find us on FaceBook" /></div>
<div class="ftTw" style="float:left; width:20%; text-align:center; margin:0 auto;"><img src="<?php echo $this->getSkinUrl() ?>images/logos/footer-twitter.png" alt="Follow us on Twitter" /></div>
<div class="ftSt" style="float:left; width:20%; text-align:center; margin:0 auto;"><img src="<?php echo $this->getSkinUrl() ?>images/logos/footer-stripe.png" alt="Secure Card Payments by Stripe" /></div>
<div class="ftPp" style="float:left; width:20%; text-align:center; margin:0 auto;"><img src="<?php echo $this->getSkinUrl() ?>images/logos/footer-paypal.png" alt="Pay Securely by PayPal" /></div>
<div class="ftTr" style="float:left; width:20%; text-align:center; margin:0 auto;"><script type="text/javascript" src="https://sealserver.trustwave.com/seal.js?style=normal"></script></div>
</div>
CSS(仅适用于小屏幕的部分):
.ftFb {display:none;}
.ftTw {display:none;}
.ftSt {display:none;}
.ftPp {display:none;}
我很高兴了解这里是否有更好的格式和提问方式:-)
谢谢,
休
【问题讨论】:
-
“我知道我需要将内联样式移到 CSS 中”真的吗?那么请这样做...
-
我使用的是 1366x768 显示器,它真的不是手机……我在底部除了徽标之外没有看到任何图像……我错过了什么……?
-
您的小屏幕媒体查询可能配置不正确。
-
很奇怪 - 我可以在我的桌面浏览器上看到所有 5 个徽标,在我的移动浏览器上看到所有 5 个徽标(包括将我的桌面浏览器调整为移动大小)。我尝试了一个全新的移动浏览器来排除任何缓存问题。我希望移动用户只能看到 Trustwave 徽标(如果您可以看到所有 5 个徽标,则为右侧)