简体   繁体   中英

Adding CSS To iframe in Shopify

I am Adding Css to the iframe in shopify . 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.

<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);}); });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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