首页 > 我想请问一下为什么控制input不能用class类和id选择器?

我想请问一下为什么控制input不能用class类和id选择器?

事情是这样的,当我用input这个标签是可以控制他的样式:

input {
   border:1px solid #ccc;
   height:30px;
   width:500px;
   line-height:150px;
   font-size:15px;
}
当我设置成有class类或者还id选择器的时候为什么不行呀、?
input .txt {
   border:1px solid #ccc;
   height:30px;
   width:500px;
   line-height:150px;
   font-size:15px;
}

哥们,你的样式写错了

input .txt {
    border:1px solid #ccc;
    height:30px;
    width:500px;
    line-height:150px;
    font-size:15px;
}

input.txt 中间没有空格


input 后面不要加空格啊亲!


input .txt{}

的意思是选择的,input标签下面的class=“txt”的元素。

【热门文章】
【热门文章】