如何设置iframe的滚动条样式? [英] how to style the scrollbar of on iframe?

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

问题描述

是否可以更改iframe滚动条的样式?

Is it possible to change the style of the scrollbars of on iframe?

我尝试使用以下代码设置样式但它似乎无法正常工作

i tried to style it by using the following code but it doesnt seem to work

html{scrollbar-arrow-color: #252604;
 scrollbar-highlight-color: #BFC097;
 scrollbar-shadow-color: #ffffff;
 scrollbar-base-color : #000000;
 scrollbar-track-color: #E2E1D4;
 scrollbar-face-color: #BFC097;
 scrollbar-3dlight-color: #EFEEEE;
 scrollbar-darkshadow-color: #999999;}

并尝试

body{scrollbar-arrow-color: #252604;
 scrollbar-highlight-color: #BFC097;
 scrollbar-shadow-color: #ffffff;
 scrollbar-base-color : #000000;
 scrollbar-track-color: #E2E1D4;
 scrollbar-face-color: #BFC097;
 scrollbar-3dlight-color: #EFEEEE;
 scrollbar-darkshadow-color: #999999;}

我弄错了吗?
iframe中的文件又在另一个域中还有一件事吗?我有过javascript不起作用的经验,但它会影响CSS吗?

Have I got it wrong? just one more thing the file in the iframe is in a different domain? i have had experiences where javascript didnt work but will it affect CSS as well??

推荐答案

没有跨浏览器的方式设置滚动条。

There is no cross-browser way to style the scrollbars.

您只能在Internet Explorer中使用的代码,并且只能在怪癖(非标准)模式下使用。

The code that you have only works in Internet Explorer, and only in quirks (non-standard) mode.

iframe中的内容与主页隔离,您必须在页面上显示滚动条的样式,即在iframe中加载的页面中。您应用于主页面的任何样式都不会影响iframe中的内容。

What you have in the iframe is isolated from the main page, you have to style the scrollbars on the page where they appear, i.e. in the page that you load in the iframe. Any styling that you apply to the main page does not affect what's in the iframe.

如果您无法更改在iframe中加载的页面内容,它不可能为它的滚动条设置样式。

If you can't change the content of the page that you load in the iframe, it's not possible to style it's scrollbars.

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

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