简体   繁体   English

Facebook iframe不受CSS影响

[英]Facebook iframe is not affected by css

      <footer class="mastfoot">
        <div class="inner">
          <iframe class="iframe" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fmyfacebookpage%3F&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;share=true&amp;height=21&amp;appId=705841689490152" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowTransparency="true"></iframe>
        </div>
      </footer>

I have this iframe, he is a facebook like facebook page button.. i want setup display none in my css, but doesn't work, the css doesn't effect the iframe.. 我有这个iframe,他是一个Facebook之类的Facebook页面按钮。。我希望设置在我的CSS中不显示,但不起作用,css不会影响iframe。

  .iframe {
    display: none;
  }

what could be the problem? 可能是什么问题呢?

It´s not about applying CSS to an iframe, because you just want to apply the CSS to the iframe tag itself, right? 这与将CSS应用于iframe无关,因为您只想将CSS应用于iframe广告代码本身,对吗? Give it an ID and try again, always worked for me: 给它一个ID,然后重试,一直对我有用:

<iframe id="myIframe" src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fmyfacebookpage%3F&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;share=true&amp;height=21&amp;appId=705841689490152" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowTransparency="true"></iframe>

CSS: CSS:

#iframe {
    display: none;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM