我已经知道如何使用
删除文本输入大纲input:focus {
outline:none;
}
但它不适用于textareas并选择。感谢
编辑:已经尝试过textarea:焦点和选择:焦点,它不起作用。
答案 0 :(得分:1)
答案 1 :(得分:0)
:focus
并非必需。试试这个:
<强> HTML:强>
<textarea placeholder="without class"></textarea>
<强> CSS:强>
textarea {
outline: none;
}
<强> Without class Demo 强>
但是如果你能设置一个课程,那就更好了。
<强> HTML:强>
<textarea class="no-focus" placeholder="Look ma, no focus!"></textarea>
<select class="no-focus">
<option value="">Option, no focus!</option>
<option value="">Option, no focus!</option>
<option value="">Option, no focus!</option>
</select>
<textarea class="focus" placeholder="Your amazing textarea with focus"></textarea>
<select class="focus">
<option value="">Option, with focus</option>
<option value="">Option, with focus</option>
<option value="">Option, with focus</option>
</select>
<强> CSS:强>
.no-focus {
outline: none;
}
.focus {
outline-color: yellow;
}
/* Just for demo */
textarea {
width: 100%;
height: 100px;
}
select {
padding: 20px 0px;
width: 100%;
margin-bottom: 30px;
}
<强> Live Demo 强>