如何将样式应用于页面iframe内的div? [英] How to apply style to a div which is inside an iframe of the page?

查看:465
本文介绍了如何将样式应用于页面iframe内的div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用css和html大约6个月。我很困惑:为什么我不能将样式应用到当前页面的 iframe 中的 div

I have been working with css and html for about 6 months. I am confused: why can't I apply styles to a div which is inside an iframe of my current page?

推荐答案

内部页面在css样式方面是独立的。您可以为iframe元素本身添加样式,但如果要在其中设置div样式,则必须在子页面上引用css。

The inner page is independent when it comes to css styles. You can add styles to the iframe element itself, but if you want to style divs inside it, you would have to reference the css on the child page.

这篇关于如何将样式应用于页面iframe内的div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆