aplicação de preenchimento (2)

1. Código:

<!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;
          }

          .nav a{
                  /* a属于行内元素  此时必须要转换  行内块元素 */
                  display: inline;
                  height: 41px;
                  
                  /* 上下不需要像素  左右需要像素 */
                  padding: 0 20px;

                  /* 文字大小 */
                  font-size: 15px;
                  
                  /* 颜色 */
                  color: #4c4c4c;
                  
                  /* 取消下划线 */
                  text-decoration: none;
          }

                /* 变换文字底色 */
          .nav a:hover{
                  background-color: #eee;
                  color:  #ff8500;
          }


    </style>

</head>

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

</html>

2. Efeito da operação:

 

 

Acho que você gosta

Origin blog.csdn.net/weixin_42900834/article/details/123455311
Recomendado
Clasificación