如何使用CSS设置"文本焦点线" -thingy?

时间:2015-05-19 06:39:03

标签: html css user-interface

如何使用CSS设置此样式(用于文本输入框):

enter image description here

另外,这件事的正确术语是什么?

2 个答案:

答案 0 :(得分:3)

input:focus { 
 /* Your CSS Rules and Property */ 
  color: red;
  font-weight: bold;
}

答案 1 :(得分:2)

这称为Caret:http://en.wikipedia.org/wiki/Caret_navigation

浏览器可以控制它的外观,除了颜色外,你不能通过@Manoj Kumar描述的方式设置文本框的样式来设置它。您也可以在JavaScript中返回它的位置。