Make CSS3 triangle with linear gradient

前端 未结 4 843
别跟我提以往
别跟我提以往 2020-11-30 13:04

I need to create button with triangle on one side (like this http://css-tricks.com/triangle-breadcrumbs/) with linear vertical gradient and border, and I wa

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 13:22

    Have you checked the css transform scaleY? With another element around the arrow (or perhaps with a pseudo element) it enables you to rescale the result.

    transform: scaleY(0.5)
    

    Example:

    http://jsfiddle.net/xaddict/hJyrU/ (webkit-only example)

    EDIT: added translateZ(0) to force GPU rendering in webkit (anti-aliased borders, mhmmmm!)

提交回复
热议问题