WebBrowser component not showing CSS 3

RoXaS picture RoXaS · Apr 19, 2012 · Viewed 12.2k times · Source

I am building a piece of software that requires a WebBrowser component. Unfortunately it won't show my page correctly.

My content uses this CSS style:

.content_mid{
background-image:url(http://img.awesome-o.net/Content_Mid.png);
background-size: 100% 100%;
vertical-align:text-top;
padding-left: 40px;
padding-right:20px;
min-height:400px; 
}

Since I already found out the WebBrowser component uses the installed version of interwebs explorer, I checked the html on Internet Explorer, and it shows perfectly.

Here you see what it shows on IE:

enter image description here

And here is how it displays on the webbrowser component:

enter image description here

So, I checked the browser version:

Debug.WriteLine("WebBrowser version: " + webBrowser1.Version);
output: WebBrowser version: 9.0.8112.16443

So that should be alright I guess.

Answer

Sam Axe picture Sam Axe · Apr 20, 2012

This page describes how to force the browser control to use a specific render mode.

You can also try this doctype:

<!DOCTYPE html>

And/Or this meta element in the head element:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />