• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5261
  • Last Modified:

transparent background, non-transparent images

I've got this page with a photo in the background where the text is printed on.

to keep the text readable I've put it in a frame (not the html <frame>), which is visible for 75%. this works.
but, in that frame there are several images (and off course text) and those are also 75% visible. I want them to be 100% visible, so only the background is partly visible through the frame and not the content.

the site is roughly build like this:

div(background) table div table div(the 75% visible frame) div(to center the table) table div(for the content; for example a & img)

[css]
.maindiv { /* this is the div which containts the background */
    background    : url("../images/waterfallbg.jpg") no-repeat fixed center 0px;
}
.alinea { /* the see-through frame */
    border                : 1px solid #000000;
    z-index                : 10;
    position            : relative;
    -moz-opacity        : 0.75;
    filter                : alpha(opacity=75);
    opacity                : 0.75;
    background-color    : #ffffff;
    padding-bottom        : 3px;
}
[/css]

what should be added to make the content 100% visible and keep the frame 75% visible?

I know that putting the following on the content does not work:
.content {
    -moz-opacity        : 1.0;
    filter                : alpha(opacity=100);
    opacity                : 1.0;
}
0
nemesis3884
Asked:
nemesis3884
  • 3
  • 2
  • 2
  • +1
1 Solution
 
seanpowellCommented:
It's a little difficult following your structure, so I can't give you an exact example - but this is the basic code to handle it. Let me know if you need more...

Online example:
http://www.pdgmedia.com/ee/opacity.html

The Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">

body
{
      margin:0;
      padding:0;
      text-align:center;
}

.maindiv
{
      background-image: url('http://www.experts-exchange.com/images/certification.gif');
      width:600px;
      height:400px;
      margin:0 auto;
      text-align:left;
}

table#mytable td
{
      width:400px;
      height:400px;
}

.holder
{
      position:relative;
      width:100%;
      height:100%;
}

.alinea
{
      border:1px solid #000000;
      position:relative;
      left:0;
      top:0;
      z-index:1;
      width:100%;
      height:100%;
      background-color:#ffffff;
      padding-bottom:3px;
      -moz-opacity:0.75;
      opacity:0.75;
      filter:alpha(opacity='75');
}

.content
{
      position:absolute;
      left:0;
      top:0;
      width:300px;
      height:300px;
      z-index:2;
      padding:10px;
}
   
</style>
</head>
<body>

<div class="maindiv">

<table id="mytable">
      <tr>
            <td>
            <div class="holder">
                  <div class="alinea"></div>
                  <div class="content">
                        <p>This text is at 100% - no need for 100% opacity...</p>
                        <p><img src="http://www.experts-exchange.com/images/logoTopLeft.gif"></p>
                  </div>
            </div>
            </td>
      </tr>
</table>

</div>

</body>
</html>


Thanks,
Sean
0
 
nemesis3884Author Commented:
what I meant with the way my site was build (div(background) table div table div(the 75% visible frame) div(to center the table) table div(for the content; for example a & img)), is that this is the hierarchy of the site.

so the content div goes into the alinea div, instead of what you did; content div outside the alinea div.

I can see why that works, but that's not really an option, because the frame has to stretch accordingly to the content. So the height of the alinea div isn't always the same.
0
 
trevorhartmanCommented:
Try putting all your content in a seperate div, maybe even outside the table.  Give it a position absolute and set its top and left properties to place it on top of your semi-transparent mask.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
nemesis3884Author Commented:
I tried something like that, but than everything inside is placed on top of each other

for a source code example: http://home.wanadoo.nl/martinvisser/website.htm
0
 
BrandwoodCommented:
filter:alpha(opacity=75, Style=4);

stick that on yer filter.  you need to give it a style
0
 
BrandwoodCommented:
sorry ignore that, you don't "need" to give it a style at all
0
 
nemesis3884Author Commented:
I've found someking of solution, but I'm not completely happy with it.

I've made two different stylesheets, for IE and NS:

IE;
filter : progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/trans.png',sizingMethod='scale');

NS;
a transparent PNG as a background
0
 
seanpowellCommented:
Question has been accepted as recommended.

Sean Powell
CSS Page Editor
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now