How do I insert the CSS below into HTML?
Here is the CSS that I would like to convert to HTML:
.group .circular-progress::before {
...
content: "10%";
...
}
Here's what I've tried to do:
<div class="group">
<div class="circular-progress" style="content: '10%'"></div>
</div>
What's throwing me off is the ::before element, or the fact that the single quotes aren't working.
UPDATE:
It now works with the below code, but am getting a new Ruby-related issue.
<% if @goals.empty? %>
<%= "You don't have any goals entered yet." %>
<% else %>
<% @goals.each do |g| %>
<% puts g.value %>
<style>.group .circular-progress::before {content: "<%= g.value %>%";}</style>
<div class="group">
<div class="circular-text"><%= g.name %></div>
<div class="circular-progress" style="background: linear-gradient(90deg, #e0e0e0 50%, transparent 50%, transparent), linear-gradient(270deg, #ff70a6 50%, #e0e0e0 50%, #e0e0e0);"></div>
</div>
<% end %>
<% end %>
On the line where I am putting the g.value, it is storing the correct input. For example - if the values are [50, 10, 100, 40], it is printing them correctly. However, each time I add a new element to the @goals array, it overrides the style content attribute, so it is showing 40 on the webpage all four times. If I add 30 for example, it shows 30 all five times, etc.