Как разместить div в конце другого div, используя flexbox?

В Python есть супер (). Это немного странно, из-за классов старого и нового стиля Python, но довольно часто используется, например. в конструкторах:

class Foo(Bar):
    def __init__(self):
        super(Foo, self).__init__()
        self.baz = 5
0
задан Ali 5 March 2019 в 14:25
поделиться

2 ответа

   .outermost_div.additional {
    display: flex;
    align-items: center;
    justify-content: flex-end; --added this
    padding-right: 60px; --added this
} 

.outermost_div {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    align-items: flex-end;
    padding-left: 8px;
    padding-right: 8px;

    .button_div {
        height: 40px;
        padding: 0 16px 0 16px;
    }

    .divider {
        display: inline-block;
        width: 1px;
        height: 40px;
        border-top: 9px solid white;
        border-bottom: 9px solid white;
    }
}

.outermost_div.additional {
    display: flex;
    align-items: center;
    justify-content: flex-end;
     padding-right: 60px;
}
<div class="outermost_div additional">
    <div class="save_div">
        <button class="button_div" onClick= 
            {props.on_selected} Save</button>
        <div class="divider"/>
        <button class="button_div" onClick={props.on_cancel}>
            Cancel
        </button>
    </div>
</div>

0
ответ дан Xenio Gracias 5 March 2019 в 14:25
поделиться

Если вы добавите немного margin-right к кнопке отмены (вместе с justify-content: flex-end на save_div). Это даст вам взгляд, который вы ищете.

.save_div {
  display: flex;
  justify-content: flex-end;
}

button.button_div:nth-child(2) {
  margin-right: 100px;
}
<div class="outermost_div additional">
  <div class="save_div">
    <button class="button_div" onClick={ props.on_selected}Save</button>
    <div class="divider" />
    <button class="button_div" onClick={props.on_cancel}>
                Cancel
            </button>
  </div>
</div>

0
ответ дан coops 5 March 2019 в 14:25
поделиться