This is the HTML code I use in my WinForms application:
<html>
<head>
<style>
#vif {
margin:20px 5px 5px 5px;
background-color:#888;
}
#inf li {
margin-left:40px;
color:#fff;
}
#inf {
margin-top:15px;
padding-bottom:15px;
display:inline-block;
}
</style>
</head>
<body>
<div id="vif">
<div id="inf">
<li>Hello!</li>
</div>
</div>
</body>
</html>
When I save personally and used IE9 to display, it works fine, but when the WebBrowser
uses it, the margin-top
on #inf
was not applied. Why? Isn't it the same IE I use? The same code display differently!
The proper render should have a gray box with margin around it and the white text should fix in the middle.
How to display properly using WebBrowser
?