元素“iframe”未定义 - 检查此文档是否为 XHTML 1.0 Strict 时发现错误!
我的网站 http://sbmcrushers.net 无法通过 XHTML 严格验证。我应该怎么办?
也许我可以使用:
<object data="include/index.html" type="text/html"
style="border:none; width:960px; height:244px; margin-top:-10px;"></object>"
但是当我使用它时它会滚动。
My website http://sbmcrushers.net can't pass XHTML strict validation. What should I do?
Maybe I can use:
<object data="include/index.html" type="text/html"
style="border:none; width:960px; height:244px; margin-top:-10px;"></object>"
But it scrolls when I use that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
XHTML 文档中不能有 iframe。不过,您可以使用
div
标签,并通过 CSS 应用overflow:scroll
。如果滚动条内的内容对于您分配给 div 的尺寸来说太大,这将导致出现滚动条。只需将
include/index.html
中的任何内容(减去 html/body 标记)放入页面本身的 div 内即可:You can't have iframes in XHTML documents. You can have
div
tags though, and applyoverflow:scroll
via CSS. This will cause a scrollbar to appear if the content inside them is too big for the dimensions you assign the div.Just throw whatever content you've got in
include/index.html
(minus the html/body markup) into the page itself, inside a div:您可以将页面验证为 XHTML 1.0 Transitional 或 XHTML5。
严格!=好。
You could validate the page as XHTML 1.0 Transitional, or XHTML5, instead.
Strict != good.
我解决了:
没有滚动条。
某些溢出类型:
可见
溢出不会被剪裁。它在元素的框外呈现。默认隐藏
溢出
被剪裁,其余内容将不可见
滚动
溢出被剪裁,但添加滚动条以查看其余内容
auto
如果溢出被剪裁,则应添加滚动条添加查看其余内容
继承
指定溢出属性的值应该从父元素继承
I solved it:
There is no scroller.
Some overflow types:
visible
The overflow is not clipped. It renders outside the element's box. This is default
hidden
The overflow is clipped, and the rest of the content will be invisible
scroll
The overflow is clipped, but a scroll-bar is added to see the rest of the content
auto
If overflow is clipped, a scroll-bar should be added to see the rest of the content
inherit
Specifies that the value of the overflow property should be inherited from the parent element