Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Cross Browser Opacity

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #39959
    zethos
    Participant

    I’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.htmlhttp://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!

    #110556
    Kitty Giraudel
    Participant

    You might want to use width: 100% instead of width: 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.

    #110559
    GAtkins
    Member

    Is neuronal misspelled?

    #110561
    zethos
    Participant

    It 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;
    }

    #110541
    matt_sanford
    Participant

    RGBA is the best way to go. https://css-tricks.com/rgba-browser-support/

    #110607
    Kitty Giraudel
    Participant

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

    #110628
    zethos
    Participant

    I think it’s figured out. Thanks for the help guys.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.