为iframe设置样式 [英] Styling an iframe

查看:257
本文介绍了为iframe设置样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用优秀的 Jalbum 为网站创建相册。生成的相册的每一页都是完整的网页,因此在网站中嵌入相册的推荐方法是使用iframe。

I'm using the excellent Jalbum to create a photo album for a website. Each page of the generated photo album is a complete webpage, so the recommended way to embed the album within a website is to use an iframe.

当我想要以对嵌入的iframe中包含的图像进行样式化。如果我添加一个规则如:

A problem arises when I want to style the images contained within the embedded iframe. If I add a rule such as:

img { 
    -ms-interpolation-mode: bicubic; 
}

到我的样式表,它不会选择iframe中的图像。有没有办法选择嵌入的iframe中包含的元素?

to my stylesheet, it does not select the images within the iframe. Is there a way to select elements contained within an embedded iframe?

当然,我可以手动编辑Jalbum创建的CSS文件,然后嵌入iframe,但我会

Of course, I could manually edit the CSS file created by Jalbum before I embed the iframe, but I would need to remember to do this every time I regenerate the album.

推荐答案

您可以使用JavaScript代码将CSS include插入到iframe的文档。

You could use JavaScript code to insert a CSS include into the document of the iframe.

这篇关于为iframe设置样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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