Here's what the problem looks like:
(Sorry about the language. It's Polish, if you're curious )
So basically I have a code based on bootstrap, it works pretty well, things look ok on different devices, but the amout of words differs in every header, so when I'm resizing the screen, the lines obviously break and header's height becomes larger, which makes the icon and the paragraph move down. And it doesn't look very nice. Happily, a very nice stranger from stackoverflow helped me overcome this. With code like this:
$(window).resize(function () {
var heig1 = $(".pad1").height();
var heig2 = $(".pad2").height();
var heig3 = $(".pad3").height();
var lrg = Math.max(heig1, heig2, heig3);
if (lrg == heig1){
$(".pad2,.pad3").height(lrg);
}
else if(lrg == heig2){
$(".pad1,.pad3").height(lrg);
}
else{
$(".pad1,.pad2").height(lrg);
}
});
Which works fine, but only for one row and I've got 4 of them. Is there a way to make this code loop through every row and change every header's height? I've tried using .each but it didn't do anything. Maybe it was my fault though.
/* .wi class gives icons their color and size */
.wi {
font-size:2em!important;
color:#ffb300;
width:62px;
margin-right:5px;
}
.marg {
margin-top:30px;
margin-bottom:30px;
}
.works h3 {
font-size:0.95em;
color:rgb(52, 73, 94);
vertical-align:middle;
display: table-cell;
width:inherit;
}
.text-icon {
margin-top:15px;
overflow:hidden;
}
p4 {
color:rgb(136, 138, 140);
text-transform:none;
font-size:0.6em;
font-weight:normal;
display:inline-block;
width:72%;
vertical-align:top;
padding-top:5px;
max-width:474px;
}
.more {
font-size:0.38em;
float:right;
margin-right:5px;
margin-top:7px;
}
<div class="row">
<div class="col-md-4 marg">
<h3 class="pad1"> Instrukcja bezpieczeństwa pożarowego <br> </h3>
<div class="text-icon">
<i class=" fa fa-fire-extinguisher wi" aria-hidden="true"> </i>
<p4> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vestibulum ante ut commodo lacinia. Aliquam id felis faucibus, mollis tortor vitae, mollis ante.</p4>
<div class="more"> Czytaj więcej... </div>
</div>
</div>
<div class="col-md-4 marg">
<h3 class="pad2">Wnioski o dofinansowanie z ZUS </h3>
<div class="text-icon">
<i class=" fa fa-dollar wi" aria-hidden="true"> </i>
<p4> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vestibulum ante ut commodo lacinia. Aliquam id felis faucibus, mollis tortor vitae, mollis ante. </p4>
<div class="more"> Czytaj więcej... </div>
</div>
</div>
<div class="col-md-4 marg">
<h3 class="pad3"> Dobór środków ochrony indywidualnej <br> </h3>
<div class="text-icon">
<i class=" fa fa-umbrella wi" aria-hidden="true"> </i>
<p4> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vestibulum ante ut commodo lacinia. Aliquam id felis faucibus, mollis tortor vitae, mollis ante. </p4>
<div class="more"> Czytaj więcej... </div>
</div>
</div>
</div>
<!-- <i class> stands for an icon from fontawesome -->