我是靠谱客的博主 会撒娇雪糕,这篇文章主要介绍bootstrap4使得div居中,Bootstrap 4在div中垂直居中放置文本,现在分享给大家,希望可以做个参考。

I have this simple HTML code (with Bootstrap) :

text to center

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute

I just want to vertically center the text "text to center" in the div, keeping the border as it is in the exemple (no height decrease).

I have tried things such my-auto or align-items-middle, also read questions asked before, but without success.

If possible I don't want to add classes (use existing bootstrap).

解决方案

You can used Flex box predefine class in Bootstrap for that:

text to center

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

For Information you can read here.

最后

以上就是会撒娇雪糕最近收集整理的关于bootstrap4使得div居中,Bootstrap 4在div中垂直居中放置文本的全部内容,更多相关bootstrap4使得div居中,Bootstrap内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(104)

评论列表共有 0 条评论

立即
投稿
返回
顶部