html - CSS Triangle with partial fill -
i want create triangle (preferably using pure css method) has 2 colors. triangle can filled height, has done dynamically on website triangle represents speed of device. want accomplish following result:
the yellow part of triangle needs adjustable. (i don't mind althering css using jquery use of images no-go). i've managed create triangle using 'border-method' , i've have managed partially fill square using background linear gradient combination of both proving quite challenge.
.arrowleft{     width: 0;     height: 0;     border-style: solid;     border-width: 15px 0 15px 100px;     border-color: transparent transparent transparent #5f5f5f;     float:left; } does have suggestions on how solve problem?
you can create 2 triangles , position relatively:
.arrowcontainer{      width: 0;      height: 0;      border-style: solid;      border-width: 15px 0 15px 100px;      border-color: transparent transparent transparent #5f5f5f;      position: relative;  }    .arrowcontainer .arrowleft {      width: 0;      height: 0;      border-style: solid;      border-width: 11px 0 12px 80px;      border-color: transparent transparent transparent red;      position: absolute;      right: 0;      top: -11px;  }<div class="arrowcontainer">    <div class="arrowleft"></div>  </div>
Comments
Post a Comment