html5 冒号隔开符对齐的完成

2021-02-22 18:28 jianzhan
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf⑻">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <title>冒号对齐</title>
  
    <style>
        .parent{display:flex}
        .left{width:50%}
        .left div{text-align: right;}
    </style>

</head>
<body>
<div class='parent'>
   <div class="left">
        <div>
            <span>名字:</span>
        </div>
        <div>
            <span>性別:</span>
        </div>
        <div>
            <span>年纪:</span>
        </div>
        <div>
            <span>定居地:</span>
        </div>
        <div>
            <span>电話号码:</span>
        </div>
    </div>
    <div class="right">
        <div>
            <span>张3风</span>
        </div>
        <div>
            <span>男</span>
        </div>
        <div>
            <span>11</span>
        </div>
        <div>
            <span>武当山</span>
        </div>
        <div>
            <span></span>
        </div>
    </div>
  </div>
  
</body>
</html>

实际效果:

以上便是本文的所有內容,期待对大伙儿的学习培训有一定的协助,也期待大伙儿多多适用脚本制作之家。