CSS - How To Make 2 Different Transparent Layers?
Below I have a html with one transparent layer. Now I would like to make more than one, but I'm puzzled by the name "div" of the transparent layer abd don't know how to declare another one. Can anyone help?
This is the HTML for the one transparent layer: Code: <html> <head><title>Untitled</title> <style type="text/css"> <!-- .tekst { color: #4c5ea1; font: 11px Arial, Helvetica, sans-serif, Arial, Helvetica, sans-serif; text-align: justify; margin-top: 0px; line-height: 16px;} div { border-top: 1px solid orange; border-bottom: 1px solid orange; border-right: 1px solid orange; border-left: 1px solid orange; width: 50%; height:40%; background-color: #ff0000; filter:alpha(opacity=40); } span { position:absolute; } --> </style> </head> <body> <div> <span class="tekst">How to make another transparent div in this html with another color and another text?</span> </div> </body> </html> Similar Tutorialshttp://www.senti.ca/~kgf/programs/pickleball/ So here's the question... how do I make this picture, not transparent? Right now it's at 75% transparency on top of that background which makes it look very faded. Any ideas? I have tried: Code: filter:alpha(opacity=100); opacity: 1; -moz-opacity:1; And placing it inside of a div... sadly this doesn't work. i want to make a select box... and attempt to make its background transparent... slightly showing a background image... i have seen this done with search boxes before. Ive seen a few topics about centering layers in browsers and it seems really complicated and often to specific to relate to my site. I used to use tables which were of course easy to center, but now at college we have to use layers (im working in design view im not a coder) and the teacher said try putting a layer in a layer and centering that but ive tried this and it doesnt work, i can get a layer in another layer, but not center it within it. This is the site im trying to do, i notice on cssvault.com cssbeauty.com most of the css sites (i know mines not really in css as such) are all centered and I was wondering how everyone does it? I went to the macromedia website and it said you can use an extension which works but for some reason it doesnt let you edit the site once you have centered it. Basically is there a simple way for me to center my site or is it really complicated? I wonder why we are learning in layers when tables center easily and move relative to each other hi, i have a container div, set at 50% opacity. i want my content to apear in here, but be 100% opacity. i thought this would work, but it doesn't... any help? #transContainer { background-color: #FFF; margin-left: auto; margin-right: auto; width: 982px; padding: 7px; height: 100%; padding-top: 0; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; } #mainContainer { background-color: #ccc; padding-top: 10px; margin-left: auto; margin-right: auto; width: 968px; height: 94%; filter:alpha(opacity=100); -moz-opacity:1.0; opacity: 1.0; } How many layers or z-indexes can you reasonably use on one page? I'm thinking mostly IE here, since that is the browser I will be working with. For instance, you design a bunch of tabs - at least 24, and have a a span or div below those tabs that contain checkboxes and text preceeding each check box, for each tab on its own layer. Maybe a maximum of 40 checkboxes/text per layer. Clicking each tab will hide/unhide the appropriate layer of checkboxes/text in the div area. I know this may be better done axaj style, but for the sake of argument, what would you think is a maximum load for this scenario for a browser (latest IE) on a standard pc that may be up to 3 years old? I've tried different implementations, but none seem to be working. I have two images crossing over each other using two position: absolute divs. When I click on the one behind using an onClick javascript function, I want that div's z-layer value to change, but none of the sites are helping me. How do I do this? Ok, I have this: Code: #background { position:relative; width:600px; height:480px; z-index:1; background-image:"/background.jpg"; border-style:none; color:#000000; } <div ID="background">Whatever</div> But it doesn't work.. why? Hi guys, I am using the following code on my page but the 'profile-description' div layer is not displaying correctly Some of the text shown as a result of this <? echo nl2br($row['description']); ?> is being shown outside the blue border created by this code : <div style="text-align:center;border:#a9c5df 1px solid;width:90%;padding:20px; background:url(images/bg-image.jpg) no-repeat 0 4px #ffffff;background-position:top right;"> PHP Code: #div-profile { position:relative; } #profile-data { position:absolute; top:-15px; right:230px; width:250px; font: 12px/17px verdana,arial,sans-serif; line-height:18px; text-align:left; } #profile-pic { position:absolute; top:0; left:-10px; width:170px; } #profile-description { position:relative; top:150px; left:60px; width:450px; font: 12px/17px verdana,arial,sans-serif; line-height:18px; text-align:left; } <div style="text-align:center;border:#a9c5df 1px solid;width:90%;padding:20px; background:url(images/bg-image.jpg) no-repeat 0 4px #ffffff;background-position:top right;"> <div id="div-profile"> <div id="profile-pic"> <img src="profile-pics/<? echo $pic ;?>" alt="" width="120" height="140" align="left"> </div> <div id="profile-data"> <br /> <strong>Name:</strong> <? echo("$row2[first_name]"); ?> <? echo("$row2[last_name]"); ?><br /> <strong>Specialist Area:</strong> <? echo("$row2[specialist_area]"); ?><br /> <strong>Phone:</strong> <? echo("$row2[phone]"); ?><br /> <strong>Mobile:</strong> <? echo("$row2[mobile]"); ?><br /> <strong>Company:</strong> <? echo("$row2[company]"); ?><br /> <strong>Address:</strong> <? echo("$row2[city]"); ?>, <? echo("$row2[state]"); ?><br /> <strong>Email:</strong> <a href="contact-agent.php?id=<? echo $_SESSION['member_id'];?>" title="Contact This Agent" onclick="NewWindow(this.href,'name','450','350','yes');return false">contact us here</a><br /> <? } ?> </div> <br /><br /> <div id="profile-description"> <? echo nl2br($row['description']); ?> <br /><br /><br /><br /> <div align="right"> <a href="contact-agent.php?id=<? echo $member_id ;?>" title="Contact This Agent" onclick="NewWindow(this.href,'name','450','350','yes');return false"> <img src="icon-email.gif" alt="Contact This Agent" width="60" height="60" hspace="10" border="0"></a> <a href="javascript:window.print()" title="Print This Page"> <img src="icon-print.gif" alt="Print This Page" width="60" height="60" border="0"></a> </div> </div> </div> Can anyone possibly help? have I got this right....any selector effectively becomes a layer once I add a 'position' and a 'z-index'? Thanks Chris I hope someone can help me with this, please have a look at a page I have created: http://www.funnestgames.com/header_1.php Now before rolling over any of the links on the left side, notice the text "Rollover game for preview". I have been trying to get that inside the white rectangular outlined box, but the only way I know is if i use css and specify a certain number of pixels from the left side. I can't do this because the website is centered, and resizing the page would change the widths and it all gets messy, i hope you have the idea. I have the same problem if you rollover a link, you can barely read it but it says loading below the text "rollover game for preview" does anyone know a way to solve my problem? please view source on page if you can help me out and see what i did wrong. the divs start at approx line 135 thanks Code: <center> <div style="width:100px; height:100px;background-color:#E0E1E2; border: 1px double #ffffff; font-size:11px; font-weight:700; color:#333333; text-align:center;">Game Preview <div style="position: absolute; top: 300px;">Rollover game for preview</div> <div id="preview" style="width:100px; height:100px;background-color:#E0E1E2; visibility:hidden; z-index:99;"> <img name="preview_img" src="spacer.gif" style="height:100px; width: 100px; visiblility:hidden; " onload="showmehideme()"> <div id="loading" style="font-size:11px; font-weight:700; color:#333333; text-align:center; position: absolute; top: 300px;">Loading...</div> </div> </div> </center> I am having trouble overlapping these two layers, they need to be relative. here is the code Code: <div id="layer1" style="position: relative; width: 99%; height: 100px; z-index: 1; border: 0px solid gray; color: #CC0066;"> <table width="80%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td style="filter: Alpha (Opacity=50); -moz-opacity: .5;" bgcolor="#EBAAA5" width="50%" height="40"></td> <td style="filter: Alpha (Opacity=50); -moz-opacity: .5;" bgcolor="#EBAAA5"></td> </tr> </table> </div> <div id="layer2" style="position: relative; width: 99%; height: 100px; z-index: 2; border: 0px solid black;"> <table width="80%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td width="50%" height="40"><font face="verdana" size="2"><b>Oh, this is fantastic!</b></font></td> <td><center><font face="verdana" size="2"><b>This works for Firefox and IE.</b></font></center></td> </tr> </table> </div> any ideas? thanks! Hi, I've been using nested layers in Dreamweaver and wanted to know if it's possible to hide all nested layers of a given layer (say A) by applying a behavior to hide just the layer A to an object? Or is it that in order to hide the nested layers also, I'll need to apply behaviors for each nested layer separately? Also, is there a way to load the content of a layer (such as swf movies, images and other stuff) only when its property is changed to visible (by default the layer is hidden). Thanks, Jayant I'm attempting to create three layers, each containing a selection list form item, only one of which will be visible at any one time, based on the selection of another selection list (not shown in the code below). The layers must be centered within a Table cell: Code: <table style="width:90%"> <tr> <td style="text-align:center;"> <div id="layer1" style="width:100%;"> <select id="select1"> <option selected>Option 1</option> <option>Option 2</option> </select> </div> <div id="layer2" style="width:100%;"> <select id="select2"> <option selected>Option A</option> <option>Option B</option> </select> </div> <div id="layer3" style="width:100%;"> <select id="select3"> <option selected>Option 1A</option> <option>Option 2B</option> </select> </div> </td> </tr> </table> . . This alone renders each layer sequentially, one on top of the other, vertically on the page, which is not what I want. I have tried using z-index values, but I think the problem stems more from the position value. I have tried using: Code: position:relative; left:0px; top:0px; on each layer, but nothing changes. I then tried using: Code: position:absolute; left:0px; top:0px; on each layer, and the layers *did* overlap each other, but were placed at the top of the page. So before I tear out all of my hair, does anyone have a suggestion for how to place these layers within a table cell so that they are a) centered horizontally within the cell, and b) overlap each other? Any help would be greatly appreciated. Thanks! - coredumped. Hello All, Im currently stuck trying to get a layer on top of a layer. The image below shows the problem. img68.imageshack.us/img68/5579/picture3cl2.png And here is a link to a code version: thenpcs.com/beta/ Any help greatfully appreciated! Is it possible to make a layer relative to the 'body' or some other container in my web page? The position of my layer changes with each screen, browser or setting but I would like to be able to keep it, say, 150px in from the left edge of the 800px wide 'container' I've made. In other words, I want a layer to act like any other selection. Thanks Chris i seem to be having trouble aligning two css layers i have a border and then content within in (content is images) i would like to align another layer in here to the middle left. can this be done? also the HTML is wrapping around the image, any way i can stop this? as the images should be along the bottom below the image. the link and data are as follows: http://wakefieldfhs.co.uk/stu/users/njacques/9 and one last thing i just noticed while testing all this, its not displaying the footer and ending data (this only occurs on my server, not on my test server. :S Code: ( layout->doExifBorder(); echo("EXIF INO HERE"); $layout->endBorder(); $layout->endBorder(); footer(); // for future refernce footer.inc include the end div's!! ?>) (this would equate to: ) Code: <div class='t-exif'><div class='b-exif'><div class='l-exif'><div class='r-exif'><div class='bl-exif'><div class='br-exif'><div class='tl-exif'><div class='tr-exif'>EXIF INO HERE</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div> </div> <div class="footer" align="center"> <a href='about.php'>about</a> | disclaimer | privacy | terms of use<br></div> </div> </body> </body> </html> Hi, http://sinistersuicide.net/lolastour12.html is the page I'm working on. Problems: - I tried using absolute positioning on my div layers but if the page was viewed on a lower resolution than what I'm using 1440x900 the div layers would move from where they were positioned. - So I transfered over to relative positioning and all was fine till I noticed a huge gap at the bottom of the page. The code for the page is: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> <title>lolastour1</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> .centre { width: 406px; height: 260px; overflow:auto; margin-right: auto; margin-left: auto; position: relative; top: -480px; left: 15px; z-index: 50; } /*hack for IE5*/ body { text-align: center; } .samplemovie { width: 500px; height: 340px; overflow:auto; margin-right: auto; margin-left: auto; position: relative; top: -1105px; left: 20px; z-index: 50; } /*hack for IE5*/ body { text-align: center; } </style> <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script> <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" /> <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script> <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> google.load("jquery", "1.3"); </script> <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" /> <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script></stylesheet> <script type="text/javascript" src="swfobject.js"></script> </head> <body bgcolor="#faabcb" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> <!-- Save for Web Slices (lolastour1.psd) --> <table width="921" height="1301" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="17"> <img src="images/lolastour1_01.jpg" width="920" height="209" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="209" alt=""></td> </tr> <tr> <td colspan="2" rowspan="5"> <img src="images/lolastour1_02.jpg" width="60" height="910" alt=""></td> <td rowspan="2"> <a href="http://"> <img src="images/Join.jpg" width="102" height="47" border="0" alt="Join"></a></td> <td colspan="2" rowspan="3"> <img src="images/lolastour1_04.jpg" width="93" height="553" alt=""></td> <td colspan="2"> <a href="http://"> <img src="images/Members.jpg" width="172" height="41" border="0" alt="Members Log In Here"></a></td> <td rowspan="3"> <img src="images/lolastour1_06.jpg" width="66" height="553" alt=""></td> <td colspan="2"> <a href="http://"> <img src="images/Gallery.jpg" width="138" height="41" border="0" alt="Gallery"></a></td> <td colspan="2" rowspan="3"> <img src="images/lolastour1_08.jpg" width="89" height="553" alt=""></td> <td colspan="2"> <a href="http://"> <img src="images/Videos.jpg" width="144" height="41" border="0" alt="Videos"></a></td> <td colspan="3" rowspan="5"> <img src="images/lolastour1_10.jpg" width="56" height="910" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="41" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="images/lolastour1_11.jpg" width="172" height="512" alt=""></td> <td colspan="2" rowspan="2"> <img src="images/lolastour1_12.jpg" width="138" height="512" alt=""></td> <td colspan="2" rowspan="4"> <img src="images/lolastour1_13.jpg" width="144" height="869" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="6" alt=""></td> </tr> <tr> <td rowspan="3"> <img src="images/lolastour1_14.jpg" width="102" height="863" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="506" alt=""></td> </tr> <tr> <td rowspan="2"> <img src="images/lolastour1_15.jpg" width="24" height="357" alt=""></td> <td colspan="7"> <a href="http://"> <img src="images/Join-17.jpg" width="521" height="40" border="0" alt="Join"></a></td> <td rowspan="2"> <img src="images/lolastour1_17.jpg" width="13" height="357" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="40" alt=""></td> </tr> <tr> <td colspan="7"> <img src="images/lolastour1_18.jpg" width="521" height="317" alt=""> </td> <td> <img src="images/spacer.gif" width="1" height="317" alt=""></td> </tr> <tr> <td rowspan="4"> <img src="images/lolastour1_19.jpg" width="34" height="181" alt=""></td> <td colspan="14"> <a href="http://"> <img src="images/Join-21.jpg" width="863" height="68" border="0" alt="Join"></a></td> <td colspan="2" rowspan="2"> <img src="images/lolastour1_21.jpg" width="23" height="123" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="68" alt=""></td> </tr> <tr> <td colspan="14"> <img src="images/lolastour1_22.jpg" width="863" height="55" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="55" alt=""></td> </tr> <tr> <td colspan="12"> <img src="images/lolastour1_23.jpg" width="703" height="26" alt=""></td> <td colspan="3" rowspan="2"> <a href="http://www.sinistersuicide.net/lolastour2.html"> <img src="images/Page-2-Tour.jpg" width="172" height="58" border="0" alt="Page 2 Of Tour"></a></td> <td rowspan="2"> <img src="images/lolastour1_25.jpg" width="11" height="58" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="26" alt=""></td> </tr> <tr> <td colspan="5"> <img src="images/lolastour1_26.jpg" width="310" height="32" alt=""></td> <td colspan="3"> <a href="http://"> <img src="images/Webmasters.jpg" width="259" height="32" border="0" alt="Webmasters"></a></td> <td colspan="4"> <img src="images/lolastour1_28.jpg" width="134" height="32" alt=""></td> <td> <img src="images/spacer.gif" width="1" height="32" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="34" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="26" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="102" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="24" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="69" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="89" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="83" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="66" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="110" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="28" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="76" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="13" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="17" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="127" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="33" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="11" height="1" alt=""></td> <td></td> </tr> </table> <div class="centre"> <a href="images/freeimage1.jpg" rel="prettyPhoto" title=""><img src="images/freeimage1thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage2.jpg" rel="prettyPhoto" title=""><img src="images/freeimage2thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage3.jpg" rel="prettyPhoto" title=""><img src="images/freeimage3thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage4.jpg" rel="prettyPhoto" title=""><img src="images/freeimage4thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage5.jpg" rel="prettyPhoto" title=""><img src="images/freeimage5thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage6.jpg" rel="prettyPhoto" title=""><img src="images/freeimage6thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage7.jpg" rel="prettyPhoto" title=""><img src="images/freeimage7thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage8.jpg" rel="prettyPhoto" title=""><img src="images/freeimage8thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage9.jpg" rel="prettyPhoto" title=""><img src="images/freeimage9thumb.jpg" width="90" height="120" alt="" /></a> <a href="images/freeimage10.jpg" rel="prettyPhoto" title=""><img src="images/freeimage10thumb.jpg" width="90" height="120" alt="" /></a> </div> <div class="samplemovie"> <script type='text/javascript' src='swfobject.js'></script> <div id='mediaspace'>This text will be replaced</div> <script type='text/javascript'> var so = new SWFObject('player.swf','mpl','450','300','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('file','http://sinistersuicide.net/lolacasting.flv'); so.addVariable('controlbar','none'); so.addVariable('autostart','true'); so.addVariable('icons','false'); so.addVariable('stretching','fill'); so.write('mediaspace'); </script> </div> <!-- End Save for Web Slices --> </body> </html> Hi I have a div (#adcontainer), in that there are some boxes (#adcontainer .ad). Inside every box there should be a small image at top 5, left 5. At top 5, right 5 there should be a price-flash-image. Everything works perfect besides the price-flash.. I can't manage to position correctly. The css I'm using is: Code: #adContainer { position: relative; width: 155px; float: left; margin: 0; margin-left: 5px; padding: 0;} #adContainer .ad { width: 100%; margin: 0; padding: 0px; border: 1px solid black; background-color: white; } #adContainer img { position: relative; display: block; top: 0px; left: 0px; padding: 3px; z-index: 1; } .price { position: absolute; width: 68px; height: 40px; top: 5px; right: 5px; background-image: url('../images/price_flash_small.png'); font-size: 13pt; font-weight: bold; text-align: center; line-height: 40px; display: block; z-index: 99; } HTML: Code: <div id="adContainer"> <div class="ad"><img src="shop/images/products/48602_small.jpg" width="94" height="100"><div class="price">24,90</div></div> <div class="ad"><img src="shop/images/products/4258_small.jpg" width="100" height="57" alt="Flow"><div class="price">78,00</div></div> <div class="ad">ad 3</div> </div> Please help! Hi; I am trying to make couple of layers, 9 to be exact in a page, all boxes are same size, but of course in different location, I have them like this: Quote: .box-1 { width: 200px; height: 155px; border: 1px; border-color: #339900; border-style: groove; position: absolute; top: 10px; left: 10px;} .box-2 { width: 200px; height: 155px; border: 1px; border-color: #339900; border-style: groove; position: absolute; top: 10px; left: 210px;} and so on for the rest of layers. as you notice all layers have some values, and just the positioning are not same, can I have all those unchanged value as a class somehow and have other values in as child or something? I could not find a way around it, to not repeat those values for 9 times when not necessary. thanks for help |