Maison  >  Article  >  interface Web  >  [bootstrap]bootstrap2如何引导div垂直居中_html/css_WEB-ITnose

[bootstrap]bootstrap2如何引导div垂直居中_html/css_WEB-ITnose

WBOY
WBOYoriginal
2016-06-24 11:23:131278parcourir

参考网址:http://www.4byte.cn/question/138712/bootstrap-how-to-center-vertical.html

部分参考自上面网页中的方法.用过bootstrap的同学知道,bootsrap2中可以使用栅格布局让div水平居中,那么如何让水平居中的div又垂直居中呢?




Some text text text text text .....


直接在css里面设置就可以实现居中,css代码:

/*web background*/.container{   display:table;   height:100%; }.row{   display: table-cell;   vertical-align: middle;}

这样就实现了div的水平加垂直剧中了,完毕!

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn