繁体   English   中英

在Shopify中将CSS添加到iframe

[英]Adding CSS To iframe in Shopify

我在shopify的iframe中添加了CSS。 但是它不起作用..这是我的代码。

 <script> $('#twitter-widget-0').load(function() { var css = '<style type="text/css"> body {background: white};</style>'; $('#twitter-widget-0').contents().find("head").append(css); }); </script> 

使用下面的代码。 如果您的DOM正确。

<script>
 $('#twitter-widget-0').load(function() {
  var css = '<style type="text/css"> body {background: white}</style>';
  $('#twitter-widget-0').contents().find("head").append(css);
});
    </script>

我得到了答案

  <script>$(document).ready(function(){$('#twitter-widget-0').load(function() {var css = '<style type="text/css"> body {background: white;}</style>';$('#twitter-widget-0').contents().find("head").append(css);}); });

暂无
暂无

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

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