1
I have 3 elements inline-block
. Are 3 squares aligned, summarizing.
So when I put one div
"daughter" in one of them, he falls and the other empties stay in position. It happens the same with all.
But if I put one div
daughter in(fill) ALL, they keep in the correct position. Otherwise, they fall.
View with the 3 Divs containing <figure>
and <p>
, everything aligns.
.blocoexp{
display:inline-block;
width:100px;
height:300px;
border:1px solid black;
}
.blocoexp figure{
width:30%;
height:80px;
border:1px solid black;
}
.blocoexp p{
width:30%;
height:80px;
border:1px solid black;
word-break:break-all;
}
<div class="blocoexp">
<figure></figure>
<p>asdasdasd</p>
</div>
<div class="blocoexp">
<figure></figure>
<p>asdasdasd</p>
</div>
<div class="blocoexp">
<figure></figure>
<p>asdasdasd</p>
</div>
Now see if I can get the contents out of one of the Ivs.
.blocoexp{
display:inline-block;
width:100px;
height:300px;
border:1px solid black;
}
.blocoexp figure{
width:30%;
height:80px;
border:1px solid black;
}
.blocoexp p{
width:30%;
height:80px;
border:1px solid black;
word-break:break-all;
}
<div id="blocoexpai">
<div class="blocoexp">
<figure></figure>
<p>asdasdasd</p>
</div>
<div class="blocoexp">
<figure></figure>
<p>asdasdasd</p>
</div>
<div class="blocoexp">
</div>
</div>
Bye! It’s just empty, the others fall.
Although your answer has solved my problem, I did not understand the logic of the thing actually. Browser reading at the base of the text?
– ropbla9
I put an improved explanation about the
vertical-align
. Tell me your opinion... if it’s easy to understand now, or if it can still be improved.– Miguel Angelo
I’m reading your answer in pieces and I can understand it. What it seems to me so far is that this property is the most complicated of all CSS.
– ropbla9
Why is the empty inline-block also not lined up in baseline? By the way, I think it lined up right? But it says that it contained text respected from the text. But why not from the inline-block already q it is proved as text?
– ropbla9
I still have a lot of trouble bro. It’s like you accept me in the face?
– ropbla9
The baseline of
inline-block
emptiness becomes equal tobottom
element, since it has no content.– Miguel Angelo
I just can’t understand the behavior of an inline-block with text. I don’t understand if it’s because the line respects the text contained in the inline-block and not it itself or if it’s something else.
– ropbla9
That’s exactly what you said. You got it. How much text is inside the
inline-block
a baseline is the basis of the text contained in this (and no longer the element as a whole). Just reinforcing what you said.– Miguel Angelo
I’m still waiting for your reply.
– ropbla9
Po had not even seen it. I mainly use the Sopt to clarify doubts, the face is not good for it... incidentally I rarely use it.
– Miguel Angelo