html - 我们可以更改 iframe src 页面上的类吗?

标签 html css

我在其中的 html 页面上调用 iframe 我有网站 url,我想更改 Logo 位置 我想在其中添加填充。所以我从网站 css 复制了相同的类,并在我的 html 页面上应用了 !important 但它不起作用。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<style>
/*website class( just for example) 
    #header_logo {
        padding: 29px 0 18px 8px;
    }*/

    // my class

    #header_logo {
        padding: 29px 0 18px 50px!important;
    }


</style>
</head>

<body>
<iframe width="100%" height="600" allowtransparency="yes" frameborder="0" src="http://airtel.in">


</iframe>

</body>
</html>

最佳答案

阿米特

使用 javascript/jquery,您可以更改 ID 或类(或添加类)..

要在 iframe 中查找内容,您可以执行以下操作:

$("iframe").contents().find('#selector')

关于html - 我们可以更改 iframe src 页面上的类吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9785627/

相关文章:

html - 文本未与要在右侧对齐的列表的图像和背景定位对齐

html - 表格 css 格式

HTML 模式阿拉伯字母

jquery - 如果执行 document.html.style.display= '' ,为什么我的网站主页仍为空白?

javascript - 菜单应该隐藏 onmouseout 但它隐藏 onmouseover

javascript - 根据条件添加或删除类

jquery - 如何将一些 html 文件调用到 html 页面的特定部分?

javascript - jquery cycle 将隐藏功能更改为禁用

css - 我怎样才能居中画廊?

css 将文本与图标对齐