1

我从这里找到了创建星级的方法

但是当我在 Intel XDK 上通过 Intel App Framework 3.0 实现时,它无法投票。我的代码是:

CSS 和 HTML:

.rating {
    unicode-bidi: bidi-override;
    direction: rtl;
    text-align: center;
    font-size: 30px;
}

.rating > span {
    display: inline-block;
    position: relative;
    width: 1.1em;
}

.rating > span:hover, 
.rating > span:hover ~ span,
.rating:not(:hover) > input:checked ~ span {
    color: transparent;
}

.rating > span:hover:before,
.rating > span:hover ~ span:before,
.rating:not(:hover) > input:checked ~ span:before {
    content: "\2605";
    position: absolute;
    left: 0;
    color: gold;
}

.rating > input {
    margin-left: -2.8em;
    margin-right: 0;
    top: 3px;
    width: 2.1em;
    height: 2.1em;
    position: relative;
    z-index: 2;
    opacity: 0;
}
<div class="rating">
  <input name="myrating" type="radio" value="5">
  <span>&#9734;</span>
  <input name="myrating" type="radio" value="4">
  <span>&#9734;</span>
  <input name="myrating" type="radio" value="3">
  <span>&#9734;</span>
  <input name="myrating" type="radio" value="2">
  <span>&#9734;</span>
  <input name="myrating" type="radio" value="1">
  <span>&#9734;</span>
</div>

我在af.ui.css中发现,没有标签时输入类型radio不会显示:

input[type="radio"],input[type="checkbox"] {display: none;}

我该怎么办?

4

1 回答 1

0

您应该能够通过使用更具体的规则来覆盖 css 规则。我建议尝试这样的事情:

.class input[type="radio"] {display: inline-block}
于 2015-07-16T00:00:58.527 回答