如何使用DOCTYPE XHTML删除IE8中的3D边框? [英] How to remove 3D border in IE8 with DOCTYPE XHTML?

查看:70
本文介绍了如何使用DOCTYPE XHTML删除IE8中的3D边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

这就是我要做的事

body {
    border: 0;
}

此处建议:从WebBrowser控件中删除边框

但是仅在使用以下文档类型时有效:

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中的示例所示:
无框架Web浏览器

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上的另一个相关问题:
删除Activex(即控件)上的边框

And here is another related question here on StackOverflow: Remove border on activex ie control

这篇关于如何使用DOCTYPE XHTML删除IE8中的3D边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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