CSS: Stripe with multiple colors

后端 未结 2 1694
挽巷
挽巷 2021-01-06 23:49

I have a navigation bar and want it to have a border at the bottom like a multi-colored stripe. For example, Google uses a multi-colored stripe like this:

2条回答
  •  星月不相逢
    2021-01-07 00:16

    I think you're much better doing this with a background image. You can keep the image really tiny by making each colour 1px wide and your image file 1px tall (they'll scale perfectly, with crisp edges).

    An example:

    .navigation-bar:after {
        content: " ";
        height: 6px;
        width: 100%;
        background: url(../img/stripe.png) repeat;
        background-size: 100% 1px;
    }
    

提交回复
热议问题