Make CSS3 triangle with linear gradient

前端 未结 4 841
别跟我提以往
别跟我提以往 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:45

    So I know that you want to do this with CSS, but I always do this in SVG:

    
    
    
    
    
    
    
    
    
    
    
    
    

    You can embed it as so:

    Triangle
    

    You could also make the toggle image in the same way, and toggle it using JavaScript or jQuery:

    $(".triangle").click(function()
    {
        if($(this).attr("src") == "triangle.svg")
            $(this).attr("src", "triangledown.svg");
    
        else $(this).attr("src", "triangle.svg");
    });
    

提交回复
热议问题