Solved

transparent background, non-transparent images

Posted on 2004-07-30
9
5,253 Views
Last Modified: 2008-02-01
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
Comment
Question by:nemesis3884
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 11675448
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
 
LVL 1

Author Comment

by:nemesis3884
ID: 11676008
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
 
LVL 8

Expert Comment

by:trevorhartman
ID: 11680179
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
 
LVL 1

Author Comment

by:nemesis3884
ID: 11683478
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:Brandwood
ID: 11714062
filter:alpha(opacity=75, Style=4);

stick that on yer filter.  you need to give it a style
0
 
LVL 1

Expert Comment

by:Brandwood
ID: 11714072
sorry ignore that, you don't "need" to give it a style at all
0
 
LVL 1

Accepted Solution

by:
nemesis3884 earned 0 total points
ID: 11718171
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
 
LVL 31

Expert Comment

by:seanpowell
ID: 11971196
Question has been accepted as recommended.

Sean Powell
CSS Page Editor
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

920 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

15 Experts available now in Live!

Get 1:1 Help Now