Ad

Adding CSS To Iframe In Shopify

- 1 answer

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>

Ad

Answer

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>
Ad
source: stackoverflow.com
Ad