Bootstrap 4 中的 .pull-left 和 .pull-right 类发生了什么变化? [英] What happened to the .pull-left and .pull-right classes in Bootstrap 4?

查看:28
本文介绍了Bootstrap 4 中的 .pull-left 和 .pull-right 类发生了什么变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最新版本中,pull-left 和 pull-right 已被替换为 .pull-{xs,sm,md,lg,xl}-{left,right,none}

In the newest version the pull-left and pull-right have been replaced by .pull-{xs,sm,md,lg,xl}-{left,right,none}

这意味着我现在必须编写 class="pull-md-right pull-xl-right pull-,而不是编写简单的 class="pull-right"lg-right pull-sm-right pull-xs-right"

That means that instead of writing a simple class="pull-right", I will have now to write class="pull-md-right pull-xl-right pull-lg-right pull-sm-right pull-xs-right"

有没有一种不那么乏味的方法呢?

Is there a less tedious way to do it?

推荐答案

早在 2016 年最初提出这个问题时,答案是:

Back in 2016 when this question was originally asked, the answer was:

$('.pull-right').addClass('pull-xs-right').removeClass('pull-right')

但现在公认的答案应该是 Robert Went 的.

But now the accepted answer should be Robert Went's.

这篇关于Bootstrap 4 中的 .pull-left 和 .pull-right 类发生了什么变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆