小编tes*_*est的帖子

只使用css宽度填充60%的星

当我尝试style=width:60%.rating类,金色,应填写只有3星,星星其余部分应该是空白的,但它不工作.请帮帮我,我的错误是什么?

我的HTML代码:

<div class="star">
   <div class="rating" style="width:60%">
      <span>&#9734;</span>
      <span>&#9734;</span>
      <span>&#9734;</span>
      <span>&#9734;</span>
      <span>&#9734;</span> 
   </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我的css代码:

.star{ width:200px; position: relative;color: #bdbdbd;}

.rating span
 {   
    font-size:30px;
    margin-left:-4px;
    white-space: nowrap;
    overflow: hidden;
 }

.rating  span:before { 
 content:"\2605";
 position: absolute;
 color:gold;
 }
Run Code Online (Sandbox Code Playgroud)

检查小提琴链接

html css unicode

9
推荐指数
1
解决办法
5779
查看次数

标签 统计

css ×1

html ×1

unicode ×1