首页 > 为什么不能通过标签直接设置样式?

为什么不能通过标签直接设置样式?

为什么我在样式表里面这样input{width: 70%;}设置样式无效呢?必须通过id设置样式才可以
#ipt2{width: 70%;}这是为什么?

<input type="text" id="ipt2" class="form-control" >

id的优先级高。应该是你被其他哪里覆盖了


你需要再看多一遍优先级。
https://.com/a/11...

元素选择器是除了通用选择器之外最低的。

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