Eligeti Sandhyarani Eligeti Sandhyarani - 2 months ago 12
CSS Question

how to get gradient border for my hr tag

I want 50% red color and remaining any another color . I am new for web designing please help me .



hr{
background: red;
background: -webkit-linear-gradient(red, yellow);
background: -o-linear-gradient(red, yellow);
background: -moz-linear-gradient(red, yellow);
background: linear-gradient(red, yellow);
}

<hr style="width:100%; height:5px;">




Answer

These are answers of your question

hr{ background: red; /* For browsers that do not support gradients */ 
  background: -webkit-linear-gradient(left, red , yellow); /*For Safari 5.1 to 6.0 */
  background: -o-linear-gradient(right, red, yellow); /* For Opera 11.1 to 12.0 */ 
  background: -moz-linear-gradient(right, red, yellow); /* For Firefox 3.6 to 15 */ 
 background: linear-gradient(to right, red , yellow); /* Standard syntax */ }
.hr2{
    height: 25px;
    background: red; 
    background: -webkit-linear-gradient(red 50%, yellow 50%); 
    background: -o-linear-gradient(red 50%, yellow 50%); 
    background: -moz-linear-gradient(red 50%, yellow 50%);
    background: linear-gradient(red 50%, yellow 50%); 
}
<hr style="height:10px;">
<hr style="height:10px;" class="hr2">