CSS - Opacity Property Throwing An Error
When I try to validate my site's CSS, a CSS file that works in conjunction with some JavaScript files I use to randomly rotate and fade my top banner images in and out throws this error message: Property opacity doesn't exist in CSS level 2.1 but exists in : 1 1
The validator throws twelve such error messages for twelve different lines of the CSS file, three of which are these: Code: .slideshow-images-visible { opacity: 1;} .slideshow-images-prev { opacity: 0; } .slideshow-images-next { opacity: 0; } In case it matters, I'm using the strict docType declaration at the top of my header: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> I'd like to continue using these files, and I also would like my CSS to validate. Can you tell me if there is a fix or work-around I can use? Similar TutorialsThought I'd run a page I'm working on through the W3C CSS validator... it doesn't seem to recognise decimals for the opacity property? Is this a bug, I don't think I've written anything incorrectly? Hi, How do I fix this? My Stylesheet validates except for this one issue. It bugs me Here's the HTML page: Code: <div id="nav"> <img class="navrightendbutton" src="images/buttonleftend.jpg" alt="Graphic Helper" /> <a href="index.html"><img class="navbox" src="images/homelight.jpg" alt="Takes You to Home Page" style="filter:alpha(opacity=0)" onmouseover="pWidgets(this,100,50,5)" onmouseout="pWidgets(this,0,50,5)" /></a> <a href="guardian_angel_figurines_store.html"><img class="navbox" src="images/storelight.jpg" alt="Guardian Angel Store" style="filter:alpha(opacity=0)" onmouseover="pWidgets(this,100,50,5)" onmouseout="pWidgets(this,0,50,5)" /></a> <a href="about_figurines.html"><img class="navbox" src="images/aboutfigurineslight.jpg" alt="For More Information About Figurines" style="filter:alpha(opacity=0)" onmouseover="pWidgets(this,100,50,5)" onmouseout="pWidgets(this,0,50,5)" /></a> <a href="about_angels.html"><img class="navbox" src="images/aboutangelslight.jpg" alt="For Angelic Understandings, Mysteries and More" style="filter:alpha(opacity=0)" onmouseover="pWidgets(this,100,50,5)" onmouseout="pWidgets(this,0,50,5)" /></a> <a href="privacy_policy_statement.html"><img class="navbox" src="images/contactuslight.jpg" alt="To Contact Us with Your Questions, Sugestions, Ect" style="filter:alpha(opacity=0)" onmouseover="pWidgets(this,100,50,5)" onmouseout="pWidgets(this,0,50,5)" /></a> <img class="navbox" src="images/buttonrightend.jpg" alt="Graphic Helper" /> </div> Here's the CSS code: Code: #bodycontainerbox { float:left; background: #993399; width: 900px; padding-bottom: 7px; } .navbox { float:left; width: 126px; } .navrightendbutton { float: left; width: 125px; } W3C gives me this error fives times: Parse Error opacity=0) Thank you Ok, I am creating an image gallery that is composed of a square layer that has opacity of 50. I have created 9 other div layers within that layer to hold thumbnails. When I put images in those thumbnail divs, the image shows up as semi-transparent. I do not want this. Here is my code, how can I turn off opacity just in those div thumbnail squares? CSS Code: DIV.outer { position:absolute; left: 50%; top: 50%; width: 500px; height: 488px; border:2px solid white; margin-left: -250px; /* half of width */ margin-top: -244px; /* half of height */ } DIV.inner { position:absolute; left: 50%; top :50%; width: 500px; height: 488px; margin-left: -250px; /* half of width */ margin-top: -244px; /* half of height */ background-color:#CC6666; filter:alpha(opacity=50); -moz-opacity:.50; opacity:.50; } div.tn { position:absolute; width:115px; height:115px; background-color: #660000; layer-background-color: #660000; border: 1px none #000000; } HTML Code: <div class="outer"> <p> </p> <div class="inner"> <!--row 1!--> <div class="tn" style="z-index:2; left: 50px; top: 17px;"><img src="tn/tn_fountain.gif"></div> <div class="tn" style="z-index:2; left: 192.5px; top: 17px;"><img src="tn/tn_fountain.gif"></div> <div class="tn" style="z-index:3; left: 335px; top: 17px;"><img src="tn/tn_fountain.gif"></div> <!--row 2!--> <div class="tn" style="z-index:2; left: 50px; top: 185px;"><img src="tn/tn_fountain.gif"></div> <div class="tn" style="z-index:2; left: 192.5px; top: 185px;"><img src="tn/tn_fountain.gif"></div> <div class="tn" style="z-index:3; left: 335px; top: 185px;"><img src="tn/tn_fountain.gif"></div> <!--row 3!--> <div class="tn" style="z-index:2; left: 50px; top: 352px;"><img src="tn/tn_jackpot.gif"></div> <div class="tn" style="z-index:2; left: 192.5px; top: 352px;"><img src="tn/tn_jackpot.gif"></div> <div class="tn" style="z-index:3; left: 335px; top: 352px;"><img src="tn/tn_jackpot.gif"></div> </div> </div> What i'm trying to get at here is how do I get non transparent items in a transparent div box? Hi, I have a div which is somewhat transparent. There is no problem there. Then I have textin this div, which is also showing up with transparency, and this is the problem. I need the text to be 100% opaque. Here's the div css: Code: .rounded_STYLE { filter:alpha(opacity=60); -moz-opacity:.60; opacity:.60; width: 224px; background-color: #616161; /* if needed */ /* border: 1px solid BORDER_COLOR; */ /* if needed */ -webkit-border-radius: 4px; /* for Safari */ -moz-border-radius: 4px; /* for Firefox */ } Here's the text css: Code: .bodywhite{ margin:0px, 4px, 4px, 4px; opacity:1; font-size:10px; color:#FFFFFF; font-weight:normal; } I've tried different numbers in the opacity value, but to no avail. Here's the site:site any ideas? thanks I cut my teeth on css1 and tables years ago. I am creating a sophisticated and very graphical web site. So, I have spent the last week reading all I can find on using CSS alone to do the layout and am convinced by the many good arguments to not use tables. Although I have found good resources I still cannot get the following two layouts to work cross-browser (IE6+, Mozilla 1.6+) using CSS alone (hacks or not, don't care) nor have I found examples or explanations that lead me to believe they are possible. I want to be wrong, however I suspect no one will be able to achieve these common, although somewhat complex layouts, using CSS-P alone. Can you do it? I really hope so. Any help is greatly appreciated. Rule #1: each layout must work whether the parent is the body or the layout is nested inside of another div Rule #2: using the argument that the layout is either undesireable or inappropriate for the web does not constitute success NOTE: I'm a new subscriber and am prohibited from posting URLS so I've had to put a comma instead of a dot in the base url. Just cut and paste them and replace the commas with dots. Layout 1 http://www,scotthawker,com/images/2007/bxg/simplelayout.png I have a parent container (body or div) that needs to have three regions inside of it: header, content and footer. All three regions take 100% of the width of their parent container, even if the parent conainer is resized. The header region is anchored to the top and has a specified height (lets say 50px). The footer region is anchored to the very bottom of the parent container and also has a specified height (again 50px). The content region takes all vertical space of the parent container not used by the header and footer regions. So, in this example the content region's height is <parent container height> - 50px - 50px. That's it. Layout 2 http://www,scotthawker,com/images/2007/bxg/complexlayout.png This layout is identical to the first. The difference is that inside each of the three regions there are additional numbered regions: Header Region: Region1 has a specified width and height (25px by 25px). It remains at the left-most position of the header region. Region3 remains the right-most position of the header region also with a specified width and height (25px by 25px). Region2 takes up all the horizontal space between Region1 and Region3 and so its width in this case is <header region width> - 25px - 25px. Content Region: Contains three regions (4,5,6) all of which assume the height of its parent the content region. Region4 has a specified width (10px) and remains at the left-most position of the content region. Region6 remains the right-most position of the content region also with a specified width (10px). Region5 takes up all the horizontal space between Region4 and Region6 and so its width in this case is <content region width> - 10px - 10px. Footer Region: Region7 has a specified width and height (45px by 45px). It remains at the left-most position of the footer region. Region9 remains the right-most position of the footer region also with a specified width and height (45px by 45px). Region8 takes up all the horizontal space between Region7 and Region9 and so its width in this case is <footer region width> - 45px - 45px. I was wondering if anyone knows a way to have use Opacity witin a div tab but then have another div tag in side of it not affected by Opactiy. Here is the code i have I want background to be transparent but not transbox. But setting the opacity to 100 in transbox wont over ride background.: Code: <html> <head> <style type="text/css"> div.background { width: 500px; height: 250px; background-color: 000000; border: 2px solid black; opacity:0.6; } div.transbox { width: 400px; height: 180px; margin: 30px 50px; background-color: #ffffff; border: 1px solid black; opacity:0.100; } div.transbox p { margin: 30px 40px; font-weight: bold; color: #000000; } </style> </head> <body> <div class="background"> <div class="transbox"> <p>This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. This is some text that is placed in the transparent box. </p> </div> </div> </body> </html> i cant get IE to render opacity correctly. filter: alpha(opacity=50); opacity: .5; i know the filter is for Firefox and the opacity is for IE. but it doesnt seem to work. any ideas? I have opacity set for a column <td> but I only want the background image to be 50% opaque, not the text too. I tried the following... <td style="filter:alpha(opacity=50);"> <span style="filter:alpha(opacity=100);"> Text here...</span></td> Is there a reason why the 2nd style="filter:alpha()" has no effect on the text what so ever? The image is already transparent, I exported it as a PNG file with transparency allowed or what not. Can someone explain me how to set on a photo-background ( opacity 100% 640x480 ) a square of 320x320 as size and opacity @ 25% and on that square i have to put some text that is at 100% opacity. The problem is that when i set 100% opacity for the text... it gives me 100% of the 20% opacity... i need to get the full 100% of 100% opacity... can someone explain me ? And another question... how can i set an opacity for Opera Browsers ? I have a weird problem. I've applied opacity in my stylesheet for a few elements. My opacity is working fine in FF, but not in IE. Here's the code I have: filter: alpha(opacity=75); -moz-opacity:0.75; opacity:.75; I've also applied it inline as well as in the stylesheet. Page is located at: ebonyevans.coastaldistribution.com/index.php The top center and top left music player should be opaque. Anyoen see what I'm doing wrong? I am trying to make the background transperency.. but the text on it should be bright and visible.. but i am not able to make the text brighter opacity:0.25; -moz-opacity:0.25; filter:alpha(opacity=25); u can look at the menu bar here http://www.harshamv.com/test/ I've set the main div content for opacity like this #content-main { margin-right:1%; margin-top:0; margin-bottom:2%; width:58%; background-color:#ffffff; filter:alpha(opacity=70); opacity:0.7; } but when I put an image in the div it acquires the opacity, and I want it to have none. I've tried to give it a style of opacity:1 and it didn't help. I tried alterting the image z-index to greater than 1 and it didn't help. How do I get the image not to acquire the opacity of the div? Thanks hi, ive been messing with opacity and want to know if i can achieve this. I would like to have a background image on my page, then lay some divs over it. I want the image to be full opacity around the divs and be faded in the divs. so i thought i'd add a class to the divs: .opaq { filter: alpha(opacity=50); opacity: 50%; -moz-opacity:0.5; } but the div inside with my content inherits the opacity and therefore is faded too is there a way of having the opacity on the background of the div yet have the content 'full' wat about z-index? to bring the content to the front heres a pic: I am trying to impose a translucency for the background image of my page (using CSS background-image), so that if there was no text on the page, the image looks solid, but when text is displayed over the page, the text takes precedence and looks solid, but the underlying bits of the background image becomes translucent, only partially showing through so as not to conflict with the text. How do I achieve that with CSS? I was thinking along the lines of doing something with the background attribute of the text itself, like an XOR bit-mask of sorts, so that underlying bits of the background image on the page would be XOR'd with the background of the text to create a washed-out effect. Or something like that. Any ideas? Thoughts? Hallo! I'm a newbie here, and in CSS too, and would like to be helped from you guys.. I want to make a content with a transparent/opacity background, and since i dont want the content to be transparent too, i make two divs. <div id="opacBkg" style=" position: absolute; z-index: 15; left: 10%; top: 155px; bottom: 20%; width: 80%; background-color:#999933; opacity: 0.50; filter: alpha(opacity = 0.50); -moz-opacity: 0.5; "></div> <div id="Content"> <h3 style="text-align:right;">Welcome to ABC Service</h3> <h1 style="text-align:right;">Wilkommen auf ABC Service</h1> </div> and i have put the Conten declaration in style.css. The #Content: #Content { position: absolute; z-index: 20; left: 10%; top: 155px; bottom: 20%; width: 80%; font-family: Garamond, "Times New Roman", Times, serif; font-size: 14px; color: #ffffff; overflow: auto; margin: 20px 10% 5px 10px; } And so i have make 2 overlapping divs.. And the problem is that the text appears to be slightly mispositioned, the text is out of the background div.... Hope you can help me... Hi all, I have been coding html and css for 4 or 5 years now and have never ran into this problem. I'm creating a personal site and have made simple text box where I use a div with a background with its' opacity lowered, but the p text inside of it is fully visible. I have written this code many times and never had a problem, but now I can't seem to get my text visible when going higher towards white on the rgb scale. Here's the css: Code: .module_container { background:#000; width:99%; height:101px; border:#fff 1px solid; } .module { background:#FFF; width:100%; height:100px; filter:alpha(opacity=30); -moz-opacity: 0.3; opacity: 0.3; overflow:scroll; } .module p { color:#ffffff; } and the html: Code: <div class="module_container"> <div class="module"> <p>Hey</p> </div> </div> the page is he http://lateralus.byethost12.com/new23/ I have a problem with a website Im working on, the text on most of the pages e.g. www.topviplimosdubai.com is supposed to have a transparent white background behind it but on some browsers naming firefox it doesn't show up making the text unreadable, I don't understand what's causing this problem but I can only imagine it to be a css compatibility problem. see my css code below I would very much appreciate your help. thank you Code: @charset "utf-8"; body { font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; background-color: #000000; margin: 0px; padding: 0px; font-size:18 qpx; background-image:url(topviplimos/BG.jpg); } .FCap { font-size:36px; font-weight:bold; } .TitleBar { position:relative; } .main2 { margin-left:125px; width:665px; overflow:hidden; margin-bottom:19px; color:#000; position:relative; filter:Alpha(opacity=40); _background:#FFFFFF; _position:static; } .main { margin-left:125px; width:665px; overflow:hidden; margin-bottom:19px; color:#000; position:relative; filter:Alpha(opacity=85); _background:#FFFFFF; _position:static; } .bd{ zoom:1; padding:22px; font:72%/1.6 Arial; position:relative; } .lower1 { margin-top: 800px; position:relative; } .bd img { float:left; left:-10px; position:relative; margin-bottom:19px; } .HigherZ { z-index:5; } .bd embed { z-index:6; } .Jia { float:left; left:-10px; position:relative; margin-bottom:19px; } .Jia2 { float:right; left:0px; position:relative; margin-bottom:19px; } .TitleTex { font-size:15px; font-weight:bold; color:#000066; position:relative; top:-9px; z-index:5; } a { text-decoration:none; color:#0000AA; font-weight:bold; } .kk { border-top-style: solid; border-top-color: #FFFFFF; border-right-color: #FFFFFF; border-bottom-color: #FFFFFF; border-left-color: #FFFFFF; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; } a:hover { font-weight:bold; color:#AA1100; } .ft[class]{ background:#FFFFFF; position:absolute; top:0; left:0; right:0; bottom:0; opacity:0.85; z-index:-1; *position:static; *opacity:1; *background:transparent; } .ft2[class]{ background:#FFFFFF; position:absolute; top:0; left:0; right:0; bottom:0; opacity:0.4; z-index:-1; *position:static; *opacity:1; *background:transparent; } Hey there I was wondering why my css opacity style: filter:alpha(opacity=30); opacity:.3; -moz-opacity:.3; is not working on IE7? but works in IE6 and Firefox! Head: PHP Code: .indexThumbA{ z-index:200; display:block; position:relative; padding:0; margin:0; border:0; cursor:pointer;} .indexThumbDiv{ display:none; position:absolute; padding:0; margin:0; border:0; left:0px; top:0px; width:100%; height:100%; background:#ffffff; filter:alpha(opacity=30); opacity:.3; -moz-opacity:.3; z-index:201;} Body: PHP Code: <a class="indexThumbA" href="#" onmouseover="document.getElementById('sixteen').style.display='block'" onmouseout="document.getElementById('sixteen').style.display='none'"> <div class="indexThumbDiv" id="sixteen"></div> <img src="#" width="120" height="120" style="vertical-align:bottom"/> </a> The div just displays 100% white not 30% white. Thanks Does anyone know an element to control table opacity for a stylesheet? Or a stand-alone tag, for that matter...? Please look at this page - http://www.tmhdesign2.com See the nav bar with the green background and white font? I want that background to have an opacity of say 70% but when I do that the font also gets that opacity which is what I don't want. |