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
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