给按钮添加了个css按钮就不能按了,怎么解决这个问题
这个是html里面的代码
class="ssk"> <input class="wss" type="text" placeholder="内容" autocomplete="on"> <button type="button" class="wss1">搜索button> div>
这个是css里面的
.ssk{
margin: 0px;
padding: 0px;
width: 260px;
height: 55px;
display: flex;
z-index: 12;
}
.wss{
width: 0px;
height: 53px;
color: rgba(38,38,38,0.00);
background: rgba(250,250,250,1.00);
text-align: center;
outline: none;
border: 0px rgba(230,230,230,0.00) solid;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
transition: 0.5s;
}
.wss1{
width: 55px;
height: 55px;
text-align: center;
background: rgba(240,240,240,1.00);
border: 2px rgba(230,230,230,1.00) solid;
border-radius: 20px;
}
.wss,.wss1,.ssk{
font-size: 12px;
font-family: 宋体;
color: #262626;
}
.ssk:hover .wss{
width: 200px;
height: 53px;
color: rgba(38,38,38,1.00);
background: rgba(240,240,240,1.00);
border: 0px rgba(230,230,230,0.80) solid;
}
.ssk:hover .wss1{
width: 55px;
height: 55px;
border: 0px rgba(230,230,230,0.80) solid;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
你好 并不是不能点击 是你没写点击的样式 所有他没发生变化
css添加以下代码
```css
/* 点击按钮 */
.wss1:active {
width: 55px;
height: 55px;
background: rgba(208, 75, 75, 0.8);
border: 0px rgba(208, 75, 75, 0.8) solid;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
```
可能是由于 CSS 的样式设置导致按钮无法被点击,你可以看看下面的几个方法能不能实现:确认 CSS 样式设置不会覆盖按钮元素,导致按钮无法被点击。可以尝试减少样式设置,或者对按钮元素进行特殊处理,例如添加一个 pointer-events: auto; 样式来启用按钮的点击功能。 或者尝试在 CSS 中添加一个 z-index 样式,将按钮的层级设置为更高,以确保它不会被其他元素覆盖。 不过你这个没有贴出js部分,如果你有js,如果使用 JavaScript 来处理按钮事件,可以检查代码是否正确,或者使用其他方法来绑定事件,例如使用 onclick 属性或者添加一个事件监听器。希望能采纳,不不不,给个关注
按钮不是可以点击么