el-input没有光标
时间: 2023-10-08 09:04:06 浏览: 214
如果你使用的是Element UI的el-input组件,而且你想去掉输入框的光标,你可以使用CSS来解决这个问题。通过设置`outline:none`属性可以隐藏光标的外边框,而设置`color:transparent`和`text-shadow:0 0 0 #000`属性可以让光标的颜色与背景色一致,从而看起来没有光标。具体的CSS代码如下:
```css
#txt {
outline: none;
color: transparent;
text-shadow: 0 0 0 #000;
height: 30px;
}
```
这样就可以让el-input输入框没有光标显示了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [input获取焦点后不显示光标,能输入显示内容](https://blog.csdn.net/qq_42767631/article/details/85266945)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [vue中el-input绑定键盘按键(按键修饰符)](https://download.csdn.net/download/weixin_38741950/13128463)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文