问题描述
问题:
这就是我要做的事
body {
border: 0;
}
此处建议:
但是仅在使用以下文档类型时有效:
But this only works when we use the following doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
文档类型更改为
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
讨厌的边界不会消失!
但是我需要XHTML文档类型以便位置:固定在IE中工作。
But I need the XHTML doctype in order for "position: fixed" to work in IE.
有任何建议吗?
代码:
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<title>Borders, Go Away!</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
</body>
</html>
CSS:
body {
border: 0;
}
推荐答案
好的,似乎有在IE中使用XHTML DOCTYPE时,无法从CSS移除边框。
OK, it seems there is no way to remove the border from CSS when XHTML DOCTYPE is used in IE.
我最终在桌面上实现了WebBrowser控件/组件的IDocHostUIHandler接口的GetHostInfo方法。应用程序,如Delphi中的示例所示:
I ended up implementing GetHostInfo method of the IDocHostUIHandler interface of the WebBrowser control/component in my desktop app, as this example in Delphi illustrates:Frameless Web Browser
这是StackOverflow上的另一个相关问题:
And here is another related question here on StackOverflow:Remove border on activex ie control
这篇关于如何使用DOCTYPE XHTML删除IE8中的3D边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!