【问题标题】:iframe validation error with scrolling HTML滚动 HTML 的 iframe 验证错误
【发布时间】:2018-11-22 08:15:50
【问题描述】:

我的大部分程序都可以验证,但这部分:

<iframe src="link.html" width='800' height='500' scrolling="no"> 
</iframe>

给出此验证错误:
“错误:iframe 元素上的滚动属性已过时。请改用 CSS。”

我尝试过使用溢出:隐藏,这似乎是常见的解决方案,但用户仍然可以滚动。我希望 iframe 没有滚动条并且用户无法滚动。

感谢您的帮助。

【问题讨论】:

标签: html validation iframe


【解决方案1】:

尝试使用 css:

iframe {
width:800px;
height:500px; /* you have to specify width and heigth, otherwise overflow has no meaning */
overflow-x:hidden;
overflow-y:hidden

}

/* optionally, you could add the following code, to keep scrolling (but not the scrollbar) for touchscreen devices */
iframe::-webkit-scrollbar {  
    display: none;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-29
    • 2013-03-07
    • 1970-01-01
    • 1970-01-01
    • 2018-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多