Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Transparent web pages?

Posted on 2003-11-02
20
Medium Priority
?
1,432 Views
Last Modified: 2008-01-09
Okay, here's the deal.

I want to create some dynamic desktop content.  So far as I can see, the only way to do that simply is to create a dynamic web page and put that on the desktop.  Fine, I have a simple example doing that with javaScript doing a rollover.  Unfortunately, the web page (which seems to be what you have to use) has a white background, which looks pretty shappy and stands-out on my desktop which has wallpaper on it (a graphics image).

So, I want to make the background of this HTML transparent.  I can't find any way of doing this.  The only thing that comes to mind is specifying a gif for the background of the page and making it an entirely transparent gif - but that doesn't seem likely.
0
Comment
Question by:Gene Klamerus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
  • 3
  • +1
20 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9668725
I don't think you're going to be able to do this - but it's a nice idea. (Unless you want to buy a MAC)
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9669017
Instead of making the html background transparent, make the backgound of the html point to the image you are currently using for your desktop...  Also consider using iframes inside your html for content because they're backgrounds can be transparent.

<html>
<head>
      <title>my desktop</title>
</head>

 <body bgcolor="#FFFFFF" leftmargin=0 topmargin=0 marginwidth="0" marginheight="0" background="location/of/my/desktop_wallpaper.jpg">

content


</body>
</html>
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9669580
<body style="background-color:transparent;">
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:Gene Klamerus
ID: 9675216
I don't think either of these will work.

First, if I set the image of the web content on my desktop to the same as an image.  Web content is places at user-defined locations on the desktop and the image behind it would use the upper-left of that web content as the origin for the image - so the image on the web page and the image on the desktop wouldn't correspond.

I tried setting the <body style...> tag, but it didn't work.  I still got the same white background.  It almost seems like I have to set the web content to the same color as the desktop and not use any images.
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9675582
Inline Frames

Most people use inline frames in a table. It's easier to put it exactly where you want it that way.

This is the html you need:

<iframe src="initial page" height="height" width="width">

If you don't want a scrollbar in your frame, add this to the basic tag:

scrolling="no"

Or, if you always want the scrollbar to show up, put "yes" instead of "no."

If you don't want a border around it, add this:

frameborder=0  border="0"

If you want a small border, add this:

style="border: 1px solid black"

Obviously, change the size/color/type to whatever you want. The different border types are: solid, dotted, dashed, double, groove, ridge, inset, outset. It's important to leave frameborder="0" in the tag because otherwise the border will look ugly.

If you have an image as your main page background and want it to show through the inline frame, you have two options. First, you can add that image as the page background to every page, after adjusting it to the right size and making sure the edges are even with the larger image, or, you can add transparency to your frame.

To add transparency, add this to the frame tag:

allowtransparency="true"

That's all you need to do to the frame. You need to add this to <style> section of every page that will show in the frame:

body {background-color: transparent}

When you do that, the frame will have a completely transparent background. Sometimes it can be hard to read the text on your page because of this (which I found out while designing version 3). Sure, it looks great, but people will be more inclined to go to your website if they can actually read it. To have a semi-transparent background (which is what I have on version 3), you need to add opacity. Put this in your <style> section instead of the above:

body {background-color: white; filter: alpha(opacity=50)}

Change the background color to whatever color you want, and change the opacity to a number between 1 and 100.


0
 
LVL 1

Expert Comment

by:dsyn
ID: 9675593
the above is a quote from: http://innocentia.org/domain/tutorials/inlineframes.htm just for some super details

try this:


the iframe holder:

<html>
<head>
<title> Test Document </title>
</head>
<body>
<iframe src="iframesource.html" height="400" width="400" allowtransparency="true">
</iframe>
</body>
</html>

------------------------------
the iframe source (iframesource.html):

<html>
<head>
<title>iframe document</title>
</head>
<body style="background-color: transparent">

blaablaablaablaablaablaa
blaablaablaablaablaablaa
blaablaablaablaablaablaa
blaablaablaablaablaablaa
blaablaablaablaablaablaa

</body>
</html>
0
 
LVL 1

Author Comment

by:Gene Klamerus
ID: 9675666
I'll need to give this a try.  As I said, this is for an Active Desktop on Windows XP.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9675815
Don't kill yourself on this one - as I mentioned, I don't think you're going to be able to pull this off :-(
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9676860
<body style="background-color: transparent">

is the solution, as I said.

If it does not work for you, you either have a buggy browser (or whatever renders your HTML), or there is another CSS definition (probably in the HEAD section) which is more restrictive.
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9678452
With all do respect - that will have no effect. (It has nothing to do with a buggy browser...)
There is no way to make the browser canvas transparent against the desktop.
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9678528
georgemarian is right, there is no way to make the browser canvas transparent against the desktop. That is why you use <body background="location/of/my/desktop_wallpaper.jpg">  in combination with transparent <iframes>... make sure your using Internet explorer as your default browser sense it is a part of the windows OS
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9678561
I appreciate how you're trying to solve this dsyn - but the problem here is one of placement. Have you tested your solution?

How will you get the background image in the active web page to line up exactly against the background image on the desktop?
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9679378
Actualy, I have created active desktops for my self before... It's alot of fun and makes it a lot easier to get stuff done.  I wrote one desktop background that had a form in it, so secretaries can send phone messages to people.  I know we can get this going for you, It's fun.

Don't use an actual desktop background, leave it empty.  Replace the background image with your html page that uses the <body background="location/of/image"> tag. In that same html page, setup tables to place the transparent <iframes>.
The iframes will actually be where the content is.

Make sure your parent table is set to 100%

this html would be your desktop wallpaper/background
-----------------------------------------------------------------------------------------------------------------------------
<html>
<head>
<title> Test Document </title>
</head>
<body background="location/of/image.jpg" leftmargin=0 topmargin=0 marginwidth="0" marginheight="0">

<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
        <tr>
              <td>
                   <table align=center>
                          <tr>
                              <td>
                                    <iframe src="iframesource.html" height="400" width="400" allowtransparency="true" name=iframe1 border=0></iframe>
                              </td>
                               <td>
                                     <iframe src="iframesource2.html" height="400" width="400" allowtransparency="true" name=iframe2 border=0></iframe>
                               </td>
                         </tr>
                   </table>
              </td>
        </tr>
</table>



</body>
</html>

---------------------------------------------------------------------------------------------------------
the iframe source (   iframesource.html and iframesource2.html   ):
---------------------------------------------------------------------------------------------------------

<html>
<head>
<title>iframe document</title>
</head>
<body style="background-color: transparent">

content

</body>
</html>


I hope that makes sense.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9679462
ok, if the desktop is too stupid, how about setting the transparent flag in the image itself, then use it as suggeset with
  background="location/of/my/desktop_wallpaper.jpg
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9681360
I have a correction sorry about that and some directions for the desktop setup:

main html
---------------------------------------------
<html>
<head>
<title> Test Document </title>
</head>
<body background="bg.jpg"  bgcolor="#FFFFFF" leftmargin=0 topmargin=0 marginwidth="0" marginheight="0" style="background-color:transparent;">


<table width=100% height=100% cellpadding=0 cellspacing=0 border=0>
        <tr>
              <td>
                   <table align=center>
                          <tr>
                              <td>
                                    <iframe src="iframesource.html" height="400" width="400" allowtransparency="true" name=iframe1 border=0 style="filter: chroma(color=ffffff)"  border="0" frameborder="0"></iframe>
                              </td>
                               <td>
                                     <iframe src="iframesource2.html" height="400" width="400" allowtransparency="true" name=iframe2 border=0 style="filter: chroma(color=ffffff)"  border="0" frameborder="0"></iframe>
                               </td>
                         </tr>
                   </table>
              </td>
        </tr>
</table>



</body>
</html>

---------------------------------------------
iframe source
------------------------------------------------
<html>
<head>
<title>iframe document</title>
</head>
<body bgcolor="#FFFFFF" style="filter: chroma(color=ffffff)">

content2


</body>
</html>


----------------------------------------------------------
setup the wallpaper
----------------------------------------------------------

1. right click on the desktop
2. click "propertie"s
3. select the "desktop" tab
4. set the background to none
5. click "apply"
6. click "customize desktop"
7. select the "web" tab
8. click "new"
9. "browse" for your file
10. click "ok"
11. do not check "Lock desktop items"
12. click "ok" for the customization porperties
13. click "ok/apply" for the desktop properties

At this point your html document will appear in a small box on your desktop then you need to:
1. move your mouse over the top border of the html box
2. a menu bar will appear, click the down arrow on the left side
3. a drop down menu will appear, click "Cover desktop"


That's it...

Finally. Sorry it took so long.
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9681515
and with some dhtml you could create draggable windows with transparent backgrounds instead of iframes.
0
 
LVL 1

Author Comment

by:Gene Klamerus
ID: 9683808
I didn't know the trick about "cover desktop".  With that, and an image in the background, I should be pretty much there.

What the point in the iframe?  Why not just put the image as the background image of the <body>?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9683870
This question is taking some bizarre turns!

If the question is can I have a web page cover my "entire" desktop? Absolutely.
If the question is can I have a transparent background within the browser canvas? Then no.

If you're happy with having the full desktop as a web page - then you don't need transparency, iframes, or any other scripting. As has been pointed out - just maximiaze the desktop browser.
0
 
LVL 1

Accepted Solution

by:
dsyn earned 2000 total points
ID: 9686761
The iframes are there to teach you about transparency. If you want to take your content deeper than just one page you'll want to use either transparent layers,divs, or iframes. By using them you wont have to create a whole bunch of pages with code already written in the original page..
0
 
LVL 1

Expert Comment

by:dsyn
ID: 9691412
Hey thanks for the good score! This was my first, so thanks for baring with me.Let me know if you need more help with this. It was fun
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question