問題:
I am trying to get blue container in the middle of pink one, however seems vertical-align: middle;
我試圖將藍色容器放在粉紅色容器的中間,但似乎vertical-align: middle;
doesn't do the job in that case.在這種情況下不做這項工作。
<div style="display: block; position: absolute; left: 50px; top: 50px;">
<div style="text-align: left; position: absolute;height: 56px;vertical-align: middle;background-color: pink;">
<div style="background-color: lightblue;">test</div>
</div>
</div>
Result:結果:
Expectation:期待:
Please suggest how can I achieve that.請建議我如何實現這一目標。
解決方案:
參考一: https://en.stackoom.com/question/1vOTE參考二: https://stackoom.com/question/1vOTE