How to make double lines border in CSS, each line in different color, without using background image?

前端 未结 11 946
广开言路
广开言路 2020-12-24 12:38

How to make a double line border in CSS, each line in a different color without using background-image?

For example like this:

11条回答
  •  梦谈多话
    2020-12-24 13:20

    Just had to do this, we're implementing a two-tone shadow in our app. Being an mobile app we want to avoid box-shadow (performance) so an even simpler solution using :after, where its absolutely positioned based on its parent is:

     :after{
       content: '';
       display: block;
       height:0;
       border-top: 1px solid rgba(0, 0, 0, .1);
       border-bottom: 2px solid rgba(0, 0, 0, .05);
       position: absolute;
       bottom: -3px;
       left: 0;
       width: 100%;
     }
    

提交回复
热议问题