How to equally distribute elements horizontally using CSS

后端 未结 6 965
一向
一向 2021-01-14 18:53

I have eleven dots arrange horizontally using CSS. How can I evenly/equally distribute spacing between elements (mine are elements) based on the wi

6条回答
  •  既然无缘
    2021-01-14 19:21

    Using flexbox, you can do something like this:

    .parent {
        display: flex;
        justify-content: space-between;
    }
    
    span.circle {
      height: 20px;
      width: 20px;
      border-radius: 100%;
      border: 1px solid #eee;
      background:#ffffd;   
      cursor: pointer;
      transition: all 0.4s ease-in-out;
    }

    JSFiddle Demo

提交回复
热议问题