There are three same-sized boxes. They have div, p, and span tag respectively.
All the boxes are flexbox and apply align-items: flex-start
but the result is different:
.small-box__a {
background: burlywood;
width: 100px;
height: 70px;
display: flex;
justify-content: center;
align-items: flex-start;
}
.small-box__b {
background: crimson;
width: 100px;
height: 70px;
display: flex;
justify-content: center;
align-items: flex-start;
}
.small-box__c {
background: coral;
width: 100px;
height: 70px;
display: flex;
justify-content: center;
align-items: flex-start;
}
<div class="small-box__a">
<div>div</div>
</div>
<div class="small-box__b">
<p>p tag</p>
</div>
<div class="small-box__c"><span>span</span></div>
the result is:
Why p tag doesn't place at the top? and how could I place the p tag at exatly the top?