• 2019-11-23

    Set flex sidebar width - the correct way


    Start a discussion

    When having a sidebar and want it to have a fixed width, it can be tempting to add width: 100px to the sidebar element. It can lead to the wrong width.

    The correct way to do it

    aside {
      flex: 0 0 100px;