Constrain width and height of image answer previews

This commit is contained in:
Charlotte Van Petegem 2025-05-24 11:00:45 +02:00
parent 6647208d3a
commit b5649a6ea8
Signed by: chvp
SSH key fingerprint: SHA256:s9rb8jBVfdahqWHuBAcHCBP1wmj4eYQXZfqgz4H3E9E
2 changed files with 12 additions and 1 deletions

View file

@ -79,6 +79,17 @@ header {
} }
} }
.answer-kind-image {
.answer-kind-image-container {
text-align: center;
img {
max-width: 100%;
max-height: 50vh;
}
}
}
.login-intro { .login-intro {
background-color: white; background-color: white;
padding: 1rem; padding: 1rem;

View file

@ -1,4 +1,4 @@
<div id="<%= "question_answer_#{question.id}_preview" %>"> <div class="answer-kind-image-container" id="<%= "question_answer_#{question.id}_preview" %>">
<% if question.answer.present? %> <% if question.answer.present? %>
<%= image_tag question.answer.image %> <%= image_tag question.answer.image %>
<% end %> <% end %>