How to create a ribbon shape in CSS

前端 未结 8 841
旧时难觅i
旧时难觅i 2021-01-05 15:00

http://jsfiddle.net/6HyjZ/

.bookmarkRibbon{
     width:0; 
     height:100px; 
     border-right:50px solid blue;
     border-left:50px solid blue;
     bord         


        
相关标签:
8条回答
  • 2021-01-05 15:30
    .bookmarkRibbon{
         width:100px; 
         height:0; 
         border-bottom:50px solid blue;
         border-top:50px solid blue;
         border-right:30px solid transparent;
    }
    
    0 讨论(0)
  • 2021-01-05 15:31

    To help you visualize the logic step-by-step
    so you can apply it easily on ANY SIDE you desire:

    CSS Ribbon Shape - How To Create

    .bookmarkRibbon {
      border:       50px solid blue;        /* All borders set */
      border-left:  0;                      /* Remove left border */
      border-right: 30px solid transparent; /* Right transparent */
      width:        100px;                  /* Increase element Width */
    }
    <div class="bookmarkRibbon"></div>

    0 讨论(0)
提交回复
热议问题