- This topic is empty.
-
AuthorPosts
-
September 22, 2012 at 6:53 pm #39959
zethos
ParticipantI’m having trouble getting my opacity to look the same on all browsers. The box is at the top of my page that the navigation is on. It looks perfect in Firefox but doesn’t show up at all in Chrome or Safari. You can see it here [Your text to link here…](http://culicanlab.businesscatalyst.com/index.html “http://culicanlab.businesscatalyst.com/index.html”)
The css for the box is:
#gray {
position:absolute;
right:0px;
top:0px;
width:200000em;
background-color: #000000;
border-bottom: 2px solid #FFFFFF;
height: 105px;
-ms-filter:”progid:DXImageTransform.Microsoft.Alpha(Opacity=40)”; // first!
filter: alpha(opacity=50);
opacity: .4;
}Thanks for the help!
September 22, 2012 at 7:16 pm #110556Kitty Giraudel
ParticipantYou might want to use
width: 100%
instead ofwidth: 200000em
. I think your browser will thank you for that. :)About opacity, you can’t do much better than:
.transparent_class {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;
/* Safari 1.x */
-khtml-opacity: 0.5;
/* Good browsers */
opacity: 0.5;
}Source: https://css-tricks.com/snippets/css/cross-browser-opacity/
You could also use a rgba or hsla color on your header instead of using an overlay. I think it would be smarter.
September 22, 2012 at 8:56 pm #110559GAtkins
MemberIs neuronal misspelled?
September 22, 2012 at 9:23 pm #110561zethos
ParticipantIt was misspelled, thanks : )
I used the opacity code from above but still nothing, any ideas what I’m doing wrong?
#gray {
position:absolute;
right:0px;
top:0px;
width:100%;
background-color: #000000;
border-bottom: 2px solid #FFFFFF;/* IE 8 */
-ms-filter: “progid:DXImageTransform.Microsoft.Alpha(Opacity=40)”;/* IE 5-7 */
filter: alpha(opacity=40);/* Netscape */
-moz-opacity: 0.4;/* Safari 1.x */
-khtml-opacity: 0.4;/* Good browsers */
opacity: 0.4;
}September 22, 2012 at 9:38 pm #110541matt_sanford
ParticipantRGBA is the best way to go. https://css-tricks.com/rgba-browser-support/
September 23, 2012 at 3:59 am #110607Kitty Giraudel
ParticipantWhat browser are you trying on? And more importantly, what are you trying to do?
I’m pretty sure there is no problem with opacity, but you may apply it to the wrong element or something.
September 23, 2012 at 2:43 pm #110628zethos
ParticipantI think it’s figured out. Thanks for the help guys.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.