Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove 3D border in IE8 with DOCTYPE XHTML?

The problem:

alt text

Here is what I do

body {
    border: 0;
}

as was suggested here: Removing border from WebBrowser control

But this only works when we use the following doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

When doctype is changed to

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

the nasty border won't go away!

But I need the XHTML doctype in order for "position: fixed" to work in IE.

Any suggestions?


The code:

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;
}
like image 691
Vitaly Avatar asked Oct 13 '10 11:10

Vitaly


1 Answers

OK, it seems there is no way to remove the border from CSS when XHTML DOCTYPE is used in IE.

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

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

like image 81
Vitaly Avatar answered Nov 15 '22 05:11

Vitaly