Styles for CSS classes in iframe
Inspired by the new User Flair , but the question applies to the general business as well.
Let's say I want to include something like this on a site that prevents me from specifying external styles or using any JavaScript code. The only thing I can do is insert object
, embed
or iframe
some other simple HTML. Also, the space width is only 160 pixels, not the default 200 required for the diff icon.
To fix this, I want to set styles for the class valuable-flair
in the iframe, namely change the width like 160px
instead 200px
. Then everything will be fine as long as the username doesn't overlap (and even when I figure it out, I can use the same method to play with it).
How can this be done?
a source to share
There is no way to change the design of an iframe with CSS if you cannot control the page in the SRC attribute.
I recommend you read src iframe server side (using PHP, Python or whatever you like) eg. fopen () src and fread () to a variable than any str_replace for that variable (to fetch content, remove <body>, </body> ...) play with the design and put the result in your page.
This way you can control the design.
a source to share