Left/Right float button inside div

后端 未结 2 705
臣服心动
臣服心动 2021-02-07 14:09

How can I make button float only in div area?

Here is my example CSS and HTML.

2条回答
  •  青春惊慌失措
    2021-02-07 14:39

    You can use justify-content: space-between in .test like so:

    .test {
      display: flex;
      justify-content: space-between;
      width: 20rem;
      border: .1rem red solid;
    }


    For those who want to use Bootstrap 4 can use justify-content-between:

    div {
      width: 20rem;
      border: .1rem red solid;
    }
    
    

提交回复
热议问题