I have a display that allows users to see selected icons with their own description.
I am using bootstrap 3.4 with the col-md-4 so that each icon is displayed 3 per line (with a total of 9 icons and their descriptions).
The description can be up to 40 chars in length and this can make the div that displays each icon a differing height as the description can wrap over 3 lines (as shown below).
This is the issue that I currently have:
This is what I am attempting to get, even if the text description is of differing lengths:
I have not used tables approach, because the user can enter only two icons, say the 1st icon and the last icon, so they must appear next to each other.
I have tried adding a height of 200px to the CSS class visual_preview_standard
and although this does work, this approach makes the div of each icon too high, especially if the user only enters a small description that does not wrap over two or more lines. There is too much un-necessary white space.
I have searched SO and read this post and this post (among many others), but the solutions I tried in each post made all the icons appear next to each other on the one line, instead of 3 icons per line.
Any suggestions would be appreciated.
Here is my HTML code:
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: indianred;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 1" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: wheat;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 2 WWWW WWWW WWWW WWWW WWWW WWWWWW WWWW" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: gold;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 3" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: aqua;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 4 WWWW WWWW WWWW WWWW WWWW WWWWWW WWWW" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: orange;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 5" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: lime;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 6" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: yellow;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 7 WWWW WWWW WWWW WWWW WWWW WWWWWW WWWW" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: aliceblue;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 8" %}</b>
</div>
</div>
<div class="col-md-4 padding-bottom-10 visual_preview_standard" dir="ltr" style="direction: ltr; background-color: pink;">
<div class="row">
<icon class="fa fa-star" style="font-size: 50px; vertical-align: middle;"></icon>
</div>
<div class="row">
<b>{% trans "Test 9 WWWW WWWW WWWW WWWW WWWW WWWWWW WWWW" %}</b>
</div>
</div>
Here is my CSS code:
.visual_preview_standard {
overflow: hidden;
text-align: center
}
.padding-bottom-10 {
padding-bottom: 10px
}