Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

transparent background, non-transparent images

Posted on 2004-07-30
9
Medium Priority
?
5,260 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
Independent Software Vendors: 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

Independent Software Vendors: 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!

Question has a verified solution.

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

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Suggested Courses

636 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