垂直对齐DIV [英] Vertical align DIVs
本文介绍了垂直对齐DIV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将顶部文本与TOP对齐,并将文本对齐如果你设置了显示屏,那么只有垂直对齐方式才有效。
表格单元
div#top,div#bottom {display:table-cell}
div#top {vertical-align:top}
div#bottom {vertical-align:bottom}
Suppose I have 2 DIVs , one on top of each other.
How do I align the text of the top one to the TOP , and align the text of the bottom one to Bottom?
解决方案
True -- vertical-align only works if you set the display
of each div to table-cell
div#top, div#bottom { display: table-cell }
div#top { vertical-align: top }
div#bottom { vertical-align: bottom }
这篇关于垂直对齐DIV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文