Add additional box-shadow to an element where existing shadow is unknown

后端 未结 4 1314
庸人自扰
庸人自扰 2021-02-14 05:17

I\'m assuming the answer to this question is that it\'s impossible, but I\'m asking anyway in the hopes that someone knows of a clever workaround.

Let\'s say I have the

4条回答
  •  失恋的感觉
    2021-02-14 05:40

    One solution might be to use a pseudo-element:

    .left-inset::after {
        content: '';
        width: 100%;
        height: 100%;
        display: block;
    
        box-shadow: 1px 0 0 rgba(255,255,255,.25);
    }
    

    It's a little bit hacky, but as long as the element hasn't defined the ::after pseudo-element already, it should work.

提交回复
热议问题