Solved

Transparent web pages?

Posted on 2003-11-02
20
1,421 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:klamerus
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 1

Author Comment

by: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: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: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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 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