博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CSS绘制星星评分实现分析
阅读量:4684 次
发布时间:2019-06-09

本文共 622 字,大约阅读时间需要 2 分钟。

效果图:

 

 

.rating {
margin: 10px 0;}.rating-3-half .star-4 {
  border-left-color: #f0991e;}.rating i {
  display: inline-block;  width: 0;  height: 1.5em;  border-width: 0 0.75em;  border-style: solid;  border-color: #eee;  border-radius: .22em;  color: white;  background: #eee;  font-style: normal;  line-height: 1.6em;  text-indent: -0.5em;  text-shadow: 1px 0 1px #b3b3b3;}

实现原理:设置包含星星的I元素高度后,然后设置其边框上下宽度为0,然后左右宽度为I元素高度的一半,需要实现半个星星时就使用border-left-color:属性。其他则设置一般的边框即可。IE6下不兼容

转载于:https://www.cnblogs.com/sakura-Master/p/4054169.html

你可能感兴趣的文章
git常用操作
查看>>
京东SSO单点登陆实现分析
查看>>
render()方法是render_to_response
查看>>
u-boot启动第一阶段
查看>>
北京大学2019年数学分析考研试题
查看>>
MySQL批量SQL插入性能优化
查看>>
定义列属性:null,default,PK,auto_increment
查看>>
用户画像展示
查看>>
pyqt pyinstaller使用说明
查看>>
C#中StreamReader读取中文出现乱码
查看>>
引用堆中的对象
查看>>
用CSS开启硬件加速来提高网站性能(转)
查看>>
使用BufferedReader的时候出现的问题
查看>>
加快页面加载速度的方法
查看>>
Oozie协作框架
查看>>
linux安装图形界面
查看>>
Android广播发送失败
查看>>
博弈论之入门小结
查看>>
解决IE8下opacity属性失效问题,无法隐藏元素
查看>>
洛谷1002 过河卒
查看>>