CSS: Why background-color breaks/removes the box-shadow?

后端 未结 3 611
无人共我
无人共我 2020-12-15 17:59

I have a pretty simple div structure - tree boxes with middle box highlighted with box-shadow:

相关标签:
3条回答
  • 2020-12-15 18:10

    It has to do with the z-index of the items. Try adding this to your existing css:

    .obOffer {
        position: relative;
        z-index: 10;
    }
    
    .obHiLight {
        position:relative;
        z-index: 100;
    }​
    
    0 讨论(0)
  • 2020-12-15 18:25

    You just need to add z-index and position:relative; see the example. http://jsfiddle.net/SqvUd/2/

    0 讨论(0)
  • 2020-12-15 18:26

    adding .obHiLight{opacity:0.999} creates a new stacking context for that element, which makes it appear above the others as well. This might work for tables too (didn't test :) . @ItJustWerks @brian-tacker

    0 讨论(0)
提交回复
热议问题