imrulhasan273
1 month ago
3503
1
General

How can I make this rating system in HTML, CSS and PHP?

Posted 1 month ago by imrulhasan273
<div class="p-rating">
 <a data-value="{{$product->id}} 1" class="btn "><i class="fa fa-star-o"></i></a>
 <a data-value="{{$product->id}} 2" class="btn "><i class="fa fa-star-o"></i></a>
 <a data-value="{{$product->id}} 3" class="btn "><i class="fa fa-star-o"></i></a>
 <a data-value="{{$product->id}} 4" class="btn "> <i class="fa fa-star-o"></i></a>
 <a data-value="{{$product->id}} 5" class="btn "> <i class="fa fa-star-o fa-fade"></i></a>
</div>

Here are 5 <a> tags one after another. All tags represent an star. here in this example the last start is blue colored with class name fa-fade. First 4 start in red star.

in this blade file there is a variable contains a value between 1 to 5. Depending on the value of the variable how can I make red star?

Please sign in or create an account to participate in this conversation.