每一行左侧定宽,文字靠右就可以了吧? <div class="container"> <div class="item"> <div class="label">姓名</div> <div class="content"> 木马啊 </div> </div> <div class="item"> <div class="label">你的身份证号码</div> <div class="content">xxx</div> </div> <div class="item"> <div class="label">居住地址</div> <div class="content">xxxx</div> </div> </div> .item { display: flex; margin: 2px; } .label { width: 150px; text-align: right; margin-right: 10px; flex-shrink: 0 } .content { flex: auto; border: 1px solid #3361d8; padding: 2px; }
每一行左侧定宽,文字靠右就可以了吧?