CSS for star ratings via FontAwesome

后端 未结 6 2073
野趣味
野趣味 2020-12-02 01:46

I\'ve tried a few variations of CSS star ratings via different methods, and am trying to implement the following via FontAwesome rather than using a sprite. I want to be abl

6条回答
  •  没有蜡笔的小新
    2020-12-02 02:46

    I find myself doing with two sets of stars styles solid and regular. Solid set declared first to have higher z-index and overlapped Regular sets of stars controlled by hidden, nowrap and width.

    .stars-rating {
    	position: relative;
        display: inline-block;
    }
    
    .stars-rating .stars-score {
                  position: absolute;
                  top: 0;
                  left: 0;
                  overflow: hidden;
                  width: 20%;
                  white-space: nowrap;
    }
    		    

提交回复
热议问题