如您所见,我-6ren">
gpt4 book ai didi

css - rails : horizontally inline values from the ratyrate gem

转载 作者:行者123 更新时间:2023-11-28 00:51:31 24 4
gpt4 key购买 nike

我正在使用 ratyrate gem在我的应用程序上,并按顺序对我的应用程序上的某些元素进行评分。以下代码显示了星星以及平均汇率数字:

<p style="font-size: 17px; display: inline-block;"><%= rating_for item, 'quality', :style=>"text-align: right;" %>
<strong style="color: #7f7f7f"><%= item.average("quality").nil? ? '0' : (item.average("quality").avg).round(2) %></strong></p>

如您所见,我用基本的 <p style="font-size: 17px; display: inline-block;"></p> 包装了所有内容为了内联星星和数字,但出于某种原因他们没有。我还尝试了一些其他方法,但没有任何运气。

关于如何内联它们有什么想法吗?

最佳答案

我找到了解决方案,我添加到不同的 div 并使用 float:left; 设置样式

<div style="float:left;"><%= rating_for item, 'quality' %></div>
<div style="float:left; margin-top: 1px;"><strong style="color: #7f7f7f"><%= item.average("quality").nil? ? '0' : (item.average("quality").avg).round(2) %></strong></div>

关于css - rails : horizontally inline values from the ratyrate gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53190614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com