Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap 4 pull-xs-right not working as expected

I have this html using bootstrap 4 utilities to pull the buttons to the right of the screen. And it does do this.

However, the buttons do not push down the content below it as expected. They end up overlayed on top of the content below.

If I do not use pull-xs-right then the buttons are left aligned, but they do push the items below.

Is there some other class I need to apply?

       <div class="pull-xs-right">
            <button click.delegate="saveEdit()"
                    type="submit"
                    class="k-button k-primary">
                Save
            </button>
            <button click.delegate="cancel()"
                    class="k-button">
                Cancel
            </button>
        </div>
like image 792
Greg Gum Avatar asked Sep 17 '16 02:09

Greg Gum


People also ask

How do I pull a button right in bootstrap 4?

Answer: Use the text-right Class You can simply use the class . text-right on the containing element to right align your Bootstrap buttons within a block box or grid column. It will work in both Bootstrap 3 and 4 versions.

What is pull right in bootstrap?

pull-right classes have been replaced with the . float-left and . float-right classes in Bootstrap 4. These utility classes are used to float an element to the left or right on the various viewport sizes based on the Bootstrap Grid.

How do you pull right in CSS?

The right property affects the horizontal position of a positioned element. This property has no effect on non-positioned elements. If position: absolute; or position: fixed; - the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor.


2 Answers

In Bootstrap 4 .float-{sm,md,lg,xl}-{left,right,none} classes were added for responsive floats, and replaced .pull-left and .pull-right.

That means:

.pull-right was replaced by .float-right

.pull-left was replaced by .float-left

.pull-xs-right is wrong, replace .pull by .float the xs between pull and right stands for extra small which determines the size of the element. The following are the options to change the element size: {xs,sm,md,lg,xl} where xs = extra small, sm = small, md = medium, lg = large and xl = extra large

See: https://v4-alpha.getbootstrap.com/migration/

like image 105
Sam Tomashi Avatar answered Oct 08 '22 20:10

Sam Tomashi


As mentioned above float replaces pull. So .float-right replaces .pull-right and .float-left replaces .pull-right. You can add -{sm,md,lg,xl} for different breakpoints for example .float-md-right will break on medium-sized screens. If you leave off the size then it will not break and will always float in the direction indicated.

like image 26
Joshua Torres Avatar answered Oct 08 '22 18:10

Joshua Torres