3 个回答

你是想选择第一个.Label

.Label:nth-of-type(1) 选取基于父元素的第一个.Label这没什么毛病,具体你的问题,没看懂。。。

选择器没有问题,试着检查下圆括号() ()。
最好晒一下chrome的截图

<style type="text/css">
        input {

        }
        .pupopName {
            display: none;
            position: fixed;
            width: 70%;
            background-color: #737373;
            height: 100px;
        }
        input:nth-of-type(1) {
            width: 300px;
            border: 1px solid #000;
            height: 40px;
        }
        .Label:nth-of-type(1) {
            background: pink;
        }
    </style>
</head>
<body>
    <input type="text">
    <div class="pupopName">123</div>
    <span class="Label">123</span>
    <span class="Label">123</span>
    <span class="Label">123</span>
    <span class="Label">123</span>
</body>

完全木有任何问题,不清楚你的无法选择到底是个什么情况。贴截图把。
图片描述

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题