我的div"评分"有问题,他的立场是对的,我想把她放在左起。
我可以使用绝对位置来解决div等级,但这不是成功解决方案。
HTML
<div class="rating">
<span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>
</div>
CSS
.rating > span:hover:before {
content: "\2605";
position: absolute;
}
.rating {
unicode-bidi: bidi-override;
direction: rtl;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
}
.rating {
unicode-bidi: bidi-override;
direction: rtl;
}
.rating > span {
display: inline-block;
position: relative;
width: 1.1em;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
}
答案 0 :(得分:1)
将评级div浮动到左侧。
.rating {
direction: rtl;
float: left;
unicode-bidi: bidi-override;
}