What do “flex” and “justify-content” achieve that “text-align” doesn't?

后端 未结 3 1168
别跟我提以往
别跟我提以往 2020-11-27 08:26

These two ways to move a button to the right of its parent seem completely equivalent to me. Is there a reason to choose one over the other? Are there circumstances in which

3条回答
  •  一整个雨季
    2020-11-27 08:40

    flex-box system provides more powerful features when it comes to aligning your content. If you have three buttons and you want them to be placed equally distant from each other, or equally distant from each other and container boundary you can give space-between or space-evenly value to justify-content property to the container. You cannot do that with text-align or float.

提交回复
热议问题