Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing blinking cursor in unfocused text input

I need to do this without any hack. Thanks.

like image 377
Mohsen Avatar asked Apr 03 '11 05:04

Mohsen


1 Answers

You won't be able to do this without some sort of hackery.

Here's a simple pure CSS hack:

input {
  background-image:     url(cursor-anim.gif);
  background-position:  4px 50%;
}
input:focus {
  background-image: none;
}

But, as others have said, It might be worth asking yourself if this may lead to your users getting confused...

like image 130
Már Örlygsson Avatar answered Nov 03 '22 03:11

Már Örlygsson