CSS “outline” different behavior behavior on Webkit & Gecko

前端 未结 3 1170
我在风中等你
我在风中等你 2020-11-30 07:37

I\'m working on an experiment & I found out that the \"outline\" CSS2 property is not implemented the same way on Webkit & Gecko

In the script below, I have

3条回答
  •  盖世英雄少女心
    2020-11-30 07:50

    I've fixed using this instead absolute positioning:

    transform: translate(x,y);
    

    .outer {
        position: absolute;
        top: 20px;
        left: 20px;
        height: 50px;
        width: 100px;
        background: blue;
        border: 3px solid green;
        outline: 3px dotted red;
    }
    .inner {
        position: absolute;
        transform: translate(80px, 15px);
        width: 40px;
        height: 20px;
        background: yellow;
    }

提交回复
热议问题