Solved

transparent background, non-transparent images

Posted on 2004-07-30
9
5,252 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Expert Comment

by:Brandwood
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Question has been accepted as recommended.

Sean Powell
CSS Page Editor
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
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…
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 style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

762 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

9 Experts available now in Live!

Get 1:1 Help Now