简体   繁体   English

在Shopify中将CSS添加到iframe

[英]Adding CSS To iframe in Shopify

I am Adding Css to the iframe in shopify . 我在shopify的iframe中添加了CSS。 but its not working.. Here is my code . 但是它不起作用..这是我的代码。

 <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> 

Use below code. 使用下面的代码。 If your DOM is proper. 如果您的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