css活用,半星星的效果
1、首先下载要用到星星字体
http://www.w3cplus.com/w3cplusDemo/demos/webFontIcon.html
2、css
.cleanfloat::after{display: block; clear: both; content:""; visibility: hidden; height: 0;}
*{margin:0; padding:0;}
/*字体路径按照你的路径去修改*/
@font-face {
font-family: 'AlluraRegular';
src: url('../common/webFontIcon/websymbols/fonts/websymbols-regular-webfont.eot'),
url('../common/webFontIcon/websymbols/fonts/websymbols-regular-webfont?#iefix') format('embedded-opentype'),
url('../common/webFontIcon/websymbols/fonts/websymbols-regular-webfont.woff') format('woff'),
url('../common/webFontIcon/websymbols/fonts/websymbols-regular-webfont.ttf') format('truetype'),
url('../common/webFontIcon/websymbols/fonts/websymbols-regular-webfont.svg#AlluraRegular') format('svg');
}
.starFive span {display: block;float: left;font-size: 25px; font-family: 'AlluraRegular';
text-align: center;color: #888;width: 27px;height: 33px;line-height: 33px;
margin-right: 5px;position: relative;overflow: hidden;white-space: pre;
}
.starFive span:before {position: absolute;
left: 0;top: 0;display: block;width: 50%;
content: attr(data-content);overflow: hidden;color: #F63;
}
.sF1 span:before{width: 70%;}
.sF2 span:before{width: 50%;}
.sF3 span:before{width: 40%;}
.starFive .org_star {color: #F63;}
.starFive b {font-weight: normal; line-height: 40px;
font-size: 25px;color: #888;margin-left: 10px;
}
3、HTML
<div>
<p class='cleanfloat starFive sF1'><span class='org_star'>R</span><span class='org_star'>R</span><span class='org_star'>R</span><span class='org_star'>R</span><span data-content='R'>R</span><b>4.7分</b></p>
<p class='cleanfloat starFive sF2'><span class='org_star'>R</span><span class='org_star'>R</span><span class='org_star'>R</span><span data-content='R'>R</span><span>R</span><b>3.5分</b></p>
<p class='cleanfloat starFive sF3'><span class='org_star'>R</span><span class='org_star'>R</span><span data-content='R'>R</span><span>R</span><span>R</span><b>2.4分</b></p>
</div>
css活用,半星星的效果的更多相关文章
- css两种动态显示星星等级的比较(一星、两星、三星、四星、五星)
原文:css两种动态显示星星等级的比较(一星.两星.三星.四星.五星) 以下是显示后的图片,相信在很多网站上都能看到这种效果,目前我知道两种实现方式 1.background-position加上一张 ...
- css的img移上去边框效果及CSS透明度
css的img移上去边框效果: .v_comment img{ height:36px; height:36px; float:left; padding:1px; margin:2px; borde ...
- 三角形变形记之纯css实现的分布导航条效果
三角形变形记,用纯css实现的分布导航条效果 <style type="text/css"> ul,li { list-style-type:none; font-si ...
- 纯CSS实现各类气球泡泡对话框效果
原文 纯CSS实现各类气球泡泡对话框效果 一.关于纯CSS实现气泡对话框 首先,来张大图: 上边这张黄黄的,大大的,圆圆的,有个小尾巴,文字内容有些YY的图片,就是使用纯CSS实现的气泡对话框效果,一 ...
- 简单css实现input提示交互动画效果
通过基础CSS实现输入提示交互动画效果,并兼容各浏览器! 1.效果展示 2.css代码 h4 { margin: 30px 0; } input { margin:; font-size: 16px; ...
- 使用CSS定位元素实现水平垂直居中效果
总结一下平时使用CSS技巧使元素达到水平居中效果 相对定位(或绝对定位)实现水平垂直居中: element{ position:relative; /*这个属性也可以是absolute*/ width ...
- 一款纯css实现的垂直时间线效果
今天给大家分享一款纯css实现的垂直时间线效果.垂直时间线适合放在类似任务时间安排的网页上.该实现采用了蓝色作为主题色,界面效果还不错.一起看下效果图: 实现的代码. html代码: ... 阅读原文 ...
- css设置背景固定不滚动效果的示例
css设置背景固定不滚动效果的示例 背景固定不滚动各位看到最多的无非就是QQ空间了,我们在很多的空间都可以看到内容滚动而北京图片不滚动了,下文整理了几个关于背景固定不滚动css代码. 一.css设置背 ...
- CSS鼠标悬停图片加边框效果,页面布局发生错位的解决办法
CSS鼠标悬停图片加边框效果,页面布局发生错位的解决办法 .recomend-list{ width:1200px; a{ @extend %fl; margin-right: 30px; width ...
随机推荐
- [BZOJ1024][SCOI2009]生日快乐解题报告
Description windy的生日到了,为了庆祝生日,他的朋友们帮他买了一个边长分别为 X 和 Y 的矩形蛋糕.现在包括windy,一共有 N 个人来分这块大蛋糕,要求每个人必须获得相同面积的蛋 ...
- Java任务调度框架----kunka
初衷 工作中用到了很多框架,但是给我印象最深的还是我们PO(Product Owner)在若干年前写的一套任务调度框架,在JDK1.4之前,concurrent包还没有引入, 手写的这套Token调度 ...
- exec,eval
一.什么是Exec语句 假如我们一串字符串里面有Python代码,这个时候,普通情况是会把这串代码作为字符串来输出的,而不会执行这段代码.如果此时,我们想执行这串字符串里面的python代码,使用Ex ...
- Laravel使用Carbon人性化显示时间
1.下载Carbon composer require nesbot/carbon Laravel自带Carbon包,可以直接使用 use Carbon\Carbon; 2.如果数据库存的是日期格式, ...
- jquery禁用select和取消禁用
$("#id").attr("disabled","disabled"); $("#id").removeAttr(&q ...
- 本地配置环境打开项目出现404/本地wampserver配置伪静态以及php.ini配置
本地wamp/phpstudy实现虚拟主机后,出现了500错误看日志看到.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled o ...
- [BZOJ2049][Sdoi2008]Cave 洞穴勘测 LCT模板
2049: [Sdoi2008]Cave 洞穴勘测 Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 9705 Solved: 4674[Submit] ...
- AC日记——[HNOI2008]越狱 bzoj 1008
1008 思路: 越狱情况=总情况-不越狱情况: 代码: #include <cstdio> #include <cstring> #include <iostream& ...
- box-shadow用法简介
语法: <strong>box-shadow:</strong><em><length></em><em><length& ...
- ZCMU训练赛-H(模拟)
H - Hard to Play MightyHorse is playing a music game called osu!. After playing for several months ...