Quantcast
Channel: Override body style for content in an iframe - Stack Overflow
Browsing all 13 articles
Browse latest View live

Answer by concatenations7 for Override body style for content in an iframe

This can be done if you're constructing the iframe with JavaScript and you have the pages markup as a string. You can parse the response's markup using DOMParser.parseFromString() with text/html then...

View Article



Answer by Nel for Override body style for content in an iframe

For juste one iframe, you can do something like this:document.querySelector('iframe').contentDocument.body.style.backgroundColor = '#1e1e2d';In case you have multiple iframe you're dealing...

View Article

Answer by Raphaƫl Balet for Override body style for content in an iframe

This should work with cross domain if you're the owner of the bothThe trick here is to assign a global css variable to your body, to listen message with the new color, and then to change the global css...

View Article

Answer by Ben for Override body style for content in an iframe

If you have control of the page hosting the iframe and the page of the iframe, you can pass a query parameter to the iframe...Here's an example to add a class to the iframe based on whether or not the...

View Article

Answer by CPHPython for Override body style for content in an iframe

Override another domainiframe CSSBy using part of SimpleSam5's answer, I achieved this with a few of Tawk's chat iframes (their customization interface is fine but I needed further customizations).In...

View Article


Answer by 2540625 for Override body style for content in an iframe

This code uses vanilla JavaScript. It creates a new <style> element. It sets the text content of that element to be a string containing the new CSS. And it appends that element directly to the...

View Article

Answer by Tim Jackson for Override body style for content in an iframe

Perhaps it's changed now, but I have used a separate stylesheet with this element:.feedEkList iframe{max-width: 435px!important;width: 435px!important;height: 320px!important;}

View Article

Answer by SimpleSam5 for Override body style for content in an iframe

The below only works if the iframe content is from the same parent domain.The following code works for me. Tested on Chrome and IE8. The inner iframe references a page that is on the same domain as the...

View Article


Answer by DA. for Override body style for content in an iframe

An iframe is a 'hole' in your page that displays another web page inside of it. The contents of the iframe is not in any shape or form part of your parent page.As others have stated, your options...

View Article


Answer by mikeq for Override body style for content in an iframe

give the body of your iframe page an ID (or class if you wish)<html><head></head><body id="myId"></body></html>then, also within the iframe's page, assign a...

View Article

Answer by mylesagray for Override body style for content in an iframe

You cannot change the style of a page displayed in an iframe unless you have direct access and therefore ownership of the source html and/or css files.This is to stop XSS (Cross Site Scripting)

View Article

Answer by Alessandro Vendruscolo for Override body style for content in an...

An iframe has another scope, so you can't access it to style or to change its content with javascript.It's basically "another page".The only thing you can do is to edit its own CSS, because with your...

View Article

Override body style for content in an iframe

How can I control the background image and colour of a body element within an iframe? Note, the embedded body element has a class, and the iframe is of a page that is part of my site. The reason I need...

View Article

Browsing all 13 articles
Browse latest View live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>