Answer the question
In order to leave comments, you need to log in
Layout. Images. The second row is displayed differently than the first
Hello.
I can't understand the reason.
Here is the site , in the "Our Portfolio" section, the items from the second row are displayed differently than from the first. They are moving out.
The code for the pictures is:
.row img{
margin-left: auto;
margin-right: auto;
display: block;
max-width: 100%;
height: auto;
}
.row img{
height: 300px;
}
Answer the question
In order to leave comments, you need to log in
You should either replace the float with an inline block or insert it through js after every third block
.clear{
clear: both;
font-size: 0;
line-height: 0;
height: 0;
overflow: hidden;
}
Try something like this codepen.io/iiil/pen/zJrvL
Why produce so many classes? write the row class, but in fact it is a cell, not a row.
In your case, such a transfer occurs due to the fact that picture number 3 has a height of 298 pixels, and the rest - 299. The blocks behave quite normally in this case.
upd: drive in instead of the third <img src="images/3.png" style="height: 299px;">
Everything will be ok. But it is better to move away from such dependence on the size of the pictures.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question