Solved

Transparent background <div> in i.e.

Posted on 2007-11-20
3
1,420 Views
Last Modified: 2013-11-19
Hi.
Anyone who can show me how to create a div with a transparent background, not transparant text, that works well with i.e?
I've tested with the following code. It gives me transparent background and transparent text in Firefox, but nothing in explorer.

Hope you can helpe me.
Best regards
Kristian
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
 
<style type="text/css">
<!--
.forside_bilde {
	float: right;
	width: 450px;
	height: 338px;
	vertical-align: middle;
	background-image:url(Illustrasjoner/Tp_09.jpg)
}
#forside_bilde_tekst {
   background: green;
   filter:alpha(opacity=40);
   -moz-opacity:.40;
   opacity:.40;
}
#forside_bilde_tekst h1 {
	color: #0000FF;
	filter:alpha(opacity=100);
   -moz-opacity:.100;
   opacity:.100;
}
-->
</style>
</head>
<body>
<div class="forside_bilde">
        <div id="forside_bilde_tekst"><h1>testText</h1></div>
 </div>
</body>
</html>

Open in new window

0
Comment
Question by:kristian_gr
  • 2
3 Comments
 
LVL 21

Expert Comment

by:jvuz
ID: 20318471
Which version of IE are we talking about?
0
 
LVL 21

Expert Comment

by:jvuz
ID: 20318473
0
 
LVL 12

Accepted Solution

by:
oceanbeach earned 500 total points
ID: 20321393
Hello kristian_gr,

Try the following page...

I hope this helps!

oceanbeach
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>html</title>
<style type="text/css">
.box {
position: relative;
width: 450px;
height: 338px;
vertical-align: middle;
}
.transparent {
background: green;
position: absolute;
width: 450px;
height: 338px;
filter:alpha(opacity=40);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40);
-moz-opacity:0.40;
opacity:0.40;
}
h1 { color: #0000FF; }
</style>
</head>
<body>
<div class="box">
  <div class="transparent"></div>
  <h1>testText</h1>
</div>
</body>
</html>

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This video teaches users how to migrate an existing Wordpress website to a new domain.
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…

809 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