Delphi Webbrowser和CSS3

Delphi Webbrowser和CSS3,delphi,css,webbrowser-control,internet-explorer-9,Delphi,Css,Webbrowser Control,Internet Explorer 9,我的应用程序将一些HTML加载到Webbrowser(TEmbeddedWB from)中,我想使用一些CSS3功能,如边界半径。我安装了Internet Explorer 9,因为它支持border radius属性。好的,为了测试该属性是否在Delphi应用程序中工作,我创建了一个带有备忘录和TEmbeddedWB的新项目。在Memo1OnChange事件中,我让Webbrowser加载备忘录中的任何文本。然后,我在备忘录中键入以下文本: <div style="background-

我的应用程序将一些HTML加载到Webbrowser(TEmbeddedWB from)中,我想使用一些CSS3功能,如
边界半径
。我安装了Internet Explorer 9,因为它支持
border radius
属性。好的,为了测试该属性是否在Delphi应用程序中工作,我创建了一个带有备忘录和TEmbeddedWB的新项目。在
Memo1OnChange
事件中,我让Webbrowser加载备忘录中的任何文本。然后,我在备忘录中键入以下文本:

<div style="background-color:green;  border-style: solid; border-width: 2px;
 border-radius: 10px 10px 10px 10px; width:200px; height:200px;"></div>

问题在于myHTML代码(参见OP)没有包括以下内容:

<meta http-equiv="X-UA-Compatible" content="IE=9" />
(来自)

由于我想强制执行IE9标准,我的Regedit窗口将如下所示:

通过这样做,你告诉你应用程序中的Webbrowser你想要使用IE9标准(CSS3和HTML5之类的)现在,我的OP中的代码仍将不起作用,即使我们刚刚这样做了。为什么?因为我缺少一个
doctype
。通过添加doctype,border radius属性起作用


希望这对其他面临同样问题的人有所帮助。

Aw,去我的-我需要metatag。。我讨厌当这种情况发生时,我在做了大量的研究后键入一个问题,2分钟后我找到了解决方案。所以把解决方案放在“答案”部分,这样它也能帮助其他人。并接受它。我们并不反对这种做法,事实上这是杰夫·阿特伍德本人鼓励的。@Rob-我害怕这样做,因为几乎每次我这样做时,我都被否决了……然后人们应该读@Marjan-让我们希望有人能使用它(甚至更好:理解我的意思:P)
<meta http-equiv="X-UA-Compatible" content="IE=9" />
9999 (0x270F):  Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the !DOCTYPE directive.
9000 (0x2328):  Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
8888 (0x22B8):  Webpages are displayed in IE8 Standards mode, regardless of the !DOCTYPE directive.
8000 (0x1F40):  Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode.
7000 (0x1B58):  Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.