在bootstrap .pull

编程入门 行业动态 更新时间:2024-10-08 10:49:16
bootstrap .pull-right中用于右对齐.pull-left用于左对齐然后什么用于中心?(In bootstrap .pull-right for align right .pull-left for align left then What for center? [duplicate])

这个问题在这里已有答案:

在一个bootstrap响应页面中如何将div 9个答案 集中在一起

在bootstrap .pull-right中用于右对齐.pull-left用于左对齐然后什么用于中心?

This question already has an answer here:

In a bootstrap responsive page how to center a div 12 answers

In bootstrap .pull-right for align right .pull-left for align left then What for center ?

最满意答案

Bootstrap的.pull-left和.pull-right使用css-float工作。

float的工作方式是在浮动元素周围流动跟随内联元素。

css-float support: left , right , none 。 没有中心选择。 因此,没有.pull-center 。

通过将css: text-align: center应用于父元素,可以对齐块元素中的所有内联元素。

如果元素是你试图居中应该是内联和块状,你应该将它设置为display: inline-block 。

你可以在bootstrap中看到一些文本对齐选项: http : //getbootstrap.com/css/#type-alignment注意<p>是一个块类型元素,其中的文本有一个隐含的文本节点display: inline 。

center-block类只能用于图像: http : //getbootstrap.com/css/#images

Bootstrap's .pull-left and .pull-right, work using css-float.

The way float works is by flowing following inline elements around the floated element.

css-float support: left, right, none. There is no center option. Therefore, there is no .pull-center.

You can align all inline elements within a block element by applying the css: text-align: center to the parent.

If the element is you're trying to center should be inline AND block-like, you should set it to have display: inline-block.

You can see some text-alignment options in bootstrap here: http://getbootstrap.com/css/#type-alignment Note that the <p> is a block-type element, and the text within has an implicit text-node which is display: inline.

The center-block class can only be used on images: http://getbootstrap.com/css/#images

更多推荐

本文发布于:2023-08-04 20:25:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422170.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:bootstrap   pull

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!