0
I’m trying to get a text to appear in line. This text is in a ruby variable on Rails. As follows:
<div class="grid" data-masonry='{ "itemSelector": ".grid-item", "columnWidth": 400 }'>
<div class="col-12" style="width: 250px;height: 350px; padding: 0;margin: 0;margin-right: 100px;text-align: center;">
<div class="col-12 col-no-left">
<a class="service-card" href="/servico/<%= service.permalink %>">
<h3 class="title" style="text-align: center;"><%= service.name %></h3>
<p class="description" style="text-align: justify;"><%=service.description.truncate(250).html_safe %>
<p class="btn">ver mais</p></p>
<span><%= service.categories.map(&:name).join(',') %></span>
</a>
</div>
</div>
The text is not justified! Can you help me? Thank you!
You have a
text-align: center;
centralizing the content of the div. You want to centralize or justify?– bfavaretto
ruby? kindness puts ruby tags, I think I’d better remove
text-align: center;
and see before @bfavaretto said.– KingRider
@Kingrider I removed the ruby tag because the doubt is not about ruby (although the code also uses this language).
– bfavaretto
You need to see if the paragraph is occupying the width of the upper div. It may be that the text is justified, but its "box" is smaller and aligned to the left. Add a
border: 1px solid red
in it to see better (or use your browser inspector to view the element).– Bacco