?
Solved

tranparent div on a html page or div

Posted on 2003-03-13
3
Medium Priority
?
265 Views
Last Modified: 2008-03-17
i want to put a transparent div ( only consist of a centered transparent image so i can see the page with text or something behind it ) and also the javascript to move it to centered of the page
thx
0
Comment
Question by:Beler
[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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
vosk earned 200 total points
ID: 8135343
You can use a filter, but only for MSIE.
Here's an example:
<html>
<head>
<script language="JavaScript">
function A()
{
var x, y;
x = screen.availHeight;
x = x / 2;
x = x - 200;
y = screen.availHeight;
y = y / 2;
y = y - 140;
document.all.im.style.pixelLeft = x;
document.all.im.style.pixelTop = y;
document.all.text.style.pixelLeft = x;
document.all.text.style.pixelTop = y;
}
</script>
</head>
<body onLoad="A();">
<img id="im" src="image.gif" style="position:absolute;visibility:visible;top:0;left:0;z-index:2;filter:alpha(opacity=50)">
<table id="text" style="position:absolute;top:0;left:0;z-index:1" width="600">
<tr><td>
That is the text behind the transparent imageThat is the text behind the transparent image
That is the text behind the transparent imageThat is the text behind the transparent image
That is the text behind the transparent imageThat is the text behind the transparent image
That is the text behind the transparent imageThat is the text behind the transparent image
That is the text behind the transparent imageThat is the text behind the transparent image
That is the text behind the transparent imageThat is the text behind the transparent image
</td></tr>
</table>
</body>
</html>
I have used a 600x280 image. You can change the opacity (from 0 to 100).
jbosch(vosk)
0
 

Author Comment

by:Beler
ID: 8200622
Thx, sorry for waiting heheh :)
0
 
LVL 3

Expert Comment

by:vosk
ID: 8202209
No problem. I'm glad to help.
jbosch(vosk)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 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…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

765 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