Solved

Transparent web pages?

Posted on 2003-11-02
20
1,419 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
Comment Utility
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
Comment Utility
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
Comment Utility
<body style="background-color:transparent;">
0
 
LVL 1

Author Comment

by:klamerus
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
<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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Expert Comment

by:dsyn
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
and with some dhtml you could create draggable windows with transparent backgrounds instead of iframes.
0
 
LVL 1

Author Comment

by:klamerus
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now