我想在我看来实现这个 HTML 代码
<div class="progress ">
<div class="progress-bar bgclre3559b" role="progressbar" style="width:80%">
<span><%= top_cat.first %></span>
</div>
<div class="progress-bar bgclre3559b" role="progressbar" style="width:15%">
<span class="clrfff"><%= "#{top_cat.last}%" %></span>
</div>
</div>
我试过这个,但它只显示里面的第二个 div。有没有办法连接它们或如何以导轨方式正确显示。
content_tag :div, class: "progress" do
content_tag :div, class: "progress-bar bgclre3559b", role: "progressbar", style: "width: 80%" do
content_tag :span, top_cat.first
end
content_tag :div, class: "progress-bar bgclre3559b", role: "progressbar", style: "width: 15%" do
content_tag :span, "#{top_cat.last}%"
end
end
提前致谢!