Two methods for vertical centering in CSS
< div id="outer"> < div id="inner">Element to be aligned< /div> < /div>
#outer { display: table; width: 100%; height: 100%; /* Height can be anything */ } #inner { display: table-cell; vertical-align: top; }
< div id="outer"> < div id="inner">Element to be aligned< /div> < /div>
#outer { display: table; width: 100%; height: 100%; /* Height can be anything */ } #inner { display: table-cell; vertical-align: top; }
沒有留言:
張貼留言