?
Solved

transparent background, non-transparent images

Posted on 2004-07-30
9
Medium Priority
?
5,259 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 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