Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Background:transparent not working in IE

  Asked By: Virendra    Date: Jul 08    Category: Sharepoint    Views: 4887

I've got an aspx file (happens with (x)html as well) that has the
following css rule sets:

body {
font-family:Arial, serif;
* {
font-family:Arial, serif;

I am using the PageViewer web part to display this page. In Mozilla
the background is transparent as I expect, but in IE (6 or 7) it is
just white.

I've tried applying the universal fix with no luck.

I have also tried this fix:

* html body#thisbody {
/* value only for IE browsers */

and then setting <body id="thisbody"> in my html to deal with the
haslayout value in ie. Still no luck.

Anyone have any ideas on this? Perhaps I'm not applying the fix
above correctly.



1 Answer Found

Answer #1    Answered By: Tatiana Houston     Answered On: Jul 08

Well, this one wasn't straightforward (at least for me) and I though I
would post the solution I found.

The problem was that when I used the pageviewer  web part  to display  a
page it only worked in non-IE web  browsers (Firefox, Safari, Opera).
The display was a white background  with IE6 & 7.

The solution I came up with was to add a bit of javascript to the
onload array (via _spBodyOnLoadFunctionNames.push() ) to set the
"allowTransparency" property of the iframe to "true" - it is "false"
by default.

The other thing to make sure of is that the master page  has the <body>
tag has body  wrapper function. Mine didn't at it caused me a bit of
thinking before I realized why the onload function wasn't added. Example:

<body onload="flyoutsAllowed=true;javascript:if
(typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">

I had the "flyoutsAllowed=true;" part only.

Didn't find what you were looking for? Find more on Background:transparent not working in IE Or get search suggestion and latest updates.