在flex弹性盒中使img图片垂直底部对齐而不被拉伸

样例:一个选择题几个选项 高度自适应
要求:每个选项等高(以最高为准) 选项中图片(图片高度不一致)垂直居底部对齐
html

选项一

选项一

css

.question,.option{
    display:flex;
}
.option{
    height: 100%;
    display: flex;
}
.option>div{
    align-items:flex-end;
    flex-shrink: 0;
}
.option span{
    display: inline-block;
     height: 100%;
     vertical-align: bottom;
}
.option img{
     display: inline-block;
     vertical-align: bottom;
}

你可能感兴趣的:(css)