パディングアプリケーション(1)

1.ボックス内の単語数が単語数と同じでない場合は、ボックスの左右のパディング値を指定すると、パディングによってボックスが開き、テキストは次のようになります。

距離は等しい。

コード:
       

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>padding应用</title>
    <style>
          .nav{
                 /* 盒子高度 */
                 height: 41px;

                 /* 上边框 */
                 border-top: 3px solid #ff8500;

                 /* 下边框 */
                 border-bottom: 1px solid #edeef0;

                /* 背景颜色 */
                 background-color: #fcfcfc;

                /* 行高 */
                 line-height: 41px;
          }
    </style>
</head>

<body>
      <div class="nav">
            <a href="#">新浪导航</a>
            <a href="#">手机新浪</a>
            <a href="#">移动客户端</a>
            <a href="#">微博</a>
            <a href="#">三个字</a>
      </div>
</body>

</html>

 実行結果

 

おすすめ

転載: blog.csdn.net/weixin_42900834/article/details/123455094