问题
suppose we have
<html>
<body>
<object width="435" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/SkPqgvQg3Mg"></object>
</body>
</html>
so after the youtube video gets loaded onto html page we get a new html page inside if we inspect element onto the video.
Now i want to style the inline html inside the object tag.
is there any way to do it??
回答1:
Short answer: no.
There is no way to do what you want with CSS included in your page because CSS only applies inside document boundaries.
And you can't circumvent this with JavaScript either, by dynamically inserting stylesheets inside the object's (/iframe) content, due to the same origin security policy, which prevents you from affecting the content of an embedded document that is on a different domain as your container page.
The kind of vulnerabilities that this security policy prevents are called cross-site scripting vulnerabilities.
回答2:
-EDIT-
I think it would be best to use iframe,not object,since it's deprecated as of January 2015
SOURCE
As for changing the css I don't think it's possible for files from other sites
来源:https://stackoverflow.com/questions/42063330/styling-object-tag-inner-content