HTML CSS automatically adjust height

后端 未结 1 1132
灰色年华
灰色年华 2021-02-15 11:59

I am trying to display outbound and inbound flight by visualising it using CSS/LESS. The problem is that when Outbound flight has more airport changes then Inbound then line sta

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 12:08

    That just screams flexbox. Support level is already at 94.82%. You will need to use all those ugly prefixes, but you can help yourself with STYLUS/LESS and the rest of 'em.

    Here's a quick outline of what you might end up with:

    .roundtrip {
      display: inline-flex;
      flex-direction: row;
      align-items: stretch;
      background-color: #909090;
    }
    
    .trip {
      width: 100px;
      text-align: center;
      border: 1px solid black;
      margin: 0px 3px;
      display: flex;
      flex-direction: column;
    }
    
    .flight {
      background-color: #B0B0B0;
      white-space: nowrap;
    }
    
    .flight-path {
      width: 6px;
      min-height: 15px;
      flex-grow: 1;
      align-self: center;
      background-color: #6090FF;
    }
    
    .connection {
      height: 40px;
      color: red;
      border: 1px solid red;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    
      
    Outbound
    Los Angeles
    Chicago
    5hr wait
    Chicago
    New York
    2hr wait
    New York
    Amsterdam
    Inbound
    Amsterdam
    Los Angeles

    0 讨论(0)
提交回复
热议问题