Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show word doc with transparent background in IFRAME

Status
Not open for further replies.

BrotherArnold

Technical User
Jul 12, 2002
16
GB
Hi,

I'm trying to load a word doc saved as a .mht web page into an IFRAME. I want the background graphic of the main page to be seen behind the doc but at the moment the doc is loaded with a white background. I've tried to format the background in word with No Fill but that doesn't work. I'm using Word 2003 and XP. My IFRAME has the ALLOW TRANSPARENCY property set to true.

I'm hoping the transparency can be set in word without having to muck about with the code as the idea is that my client can post a new "Latest News" doc to their web folder on the host without having to change code. Any solution should also work with .htm docs too.

Cheers

Brother Arnold
"You can lead a headbanger to water but you can't make him wash
 
Um... Iframes can't take a transparency value:



16.5 Inline frames: the IFRAME element

Code:
<!ELEMENT IFRAME - - (%flow;)*         -- inline subwindow -->
<!ATTLIST IFRAME
  %coreattrs;                          -- id, class, style, title --
  longdesc    %URI;          #IMPLIED  -- link to long description
                                          (complements title) --
  name        CDATA          #IMPLIED  -- name of frame for targetting --
  src         %URI;          #IMPLIED  -- source of frame content --
  frameborder (1|0)          1         -- request frame borders? --
  marginwidth %Pixels;       #IMPLIED  -- margin widths in pixels --
  marginheight %Pixels;      #IMPLIED  -- margin height in pixels --
  scrolling   (yes|no|auto)  auto      -- scrollbar or none --
  align       %IAlign;       #IMPLIED  -- vertical or horizontal alignment --
  height      %Length;       #IMPLIED  -- frame height --
  width       %Length;       #IMPLIED  -- frame width --
  >

Attribute definitions

longdesc = uri [CT]
This attribute specifies a link to a long description of the frame. This description should supplement the short description provided using the title attribute, and is particularly useful for non-visual user agents.
name = cdata [CI]
This attribute assigns a name to the current frame. This name may be used as the target of subsequent links.
width = length [CN]
The width of the inline frame.
height = length [CN]
The height of the inline frame.
Attributes defined elsewhere

id, class (document-wide identifiers)
title (element title)
style (inline style information)
name, src, frameborder, marginwidth, marginheight, scrolling (frame controls and decoration)
align (alignment)
The IFRAME element allows authors to insert a frame within a block of text. Inserting an inline frame within a section of text is much like inserting an object via the OBJECT element: they both allow you to insert an HTML document in the middle of another, they may both be aligned with surrounding text, etc.
The information to be inserted inline is designated by the src attribute of this element. The contents of the IFRAME element, on the other hand, should only be displayed by user agents that do not support frames or are configured not to display frames.

For user agents that support frames, the following example will place an inline frame surrounded by a border in the middle of the text.

<IFRAME src="foo.html" width="400" height="500"
scrolling="auto" frameborder="1">
[Your user agent does not support frames or is currently configured
not to display frames. However, you may visit
<A href="foo.html">the related document.</A>]
</IFRAME>


Inline frames may not be resized (and thus, they do not take the noresize attribute).


Since IFRAMES bring in a source from a webpage or document, you can't make their "backgrounds" transparent. You would have to "cheat" the transparency by placing the background within that document

The nature of WOrd documents however will not allow yo uto do that.
 
Thanks for the reply. If you check out you can see that I've applied ALLOWTRANSPARENCY=true on the IFRAME and STYLE="background-color: transparent" on the .htm loaded into the frame so I know that it works. Not sure where you got your info but if you search on allowtransparency you'll find it on the web. All I need is to find a way to add transparency to the word doc without changing code - might have to write a macro and get the client to stick it on their toolbar.

Cheers

Bro
 
You are using a site that has bad coding to prove that it can be done?

1. the site doesn't work in any Mozilla based browser. In fact the drop down menus do not even show up. Only shows up in Opera and IE .

2. After a visit to: 32 errors alone on their index page alone, starting with no document type declaration.
And error #32? : Line 284, column 53: there is no attribute "ALLOWTRANSPARENCY

3. "background-color: transparent" does not work in NON-IE browsers. its a fitler that is only native to Internet Explorer. And thats for IE above version 6.01. Most Mac users and Linux users do not have access to Explorer over 5.5.

However, the NATURE of Word documents, do not allow you to apply transparency values to them. If you want transparency, stay with HTML or using server side scripting (ASP, PHP, CFM) to bring in text from a text document to place it on the background of your choice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top