Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
155
rated 0 times [  159] [ 4]  / answers: 1 / hits: 6714  / 5 Years ago, tue, january 22, 2019, 12:00:00

i want the placeholder to be visible when we hover on the textbox.



  <input type=text placeholder=enter your name/>

More From » html

 Answers
9

It's not possible to currently have the functionality built into the browsers, but with a small hack, it's possible:





::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: transparent;
}
::-moz-placeholder { /* Firefox 19+ */
color: transparent;
}
:-ms-input-placeholder { /* IE 10+ */
color: transparent;
}
:-moz-placeholder { /* Firefox 18- */
color: transparent;
}
:hover::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: #999;
}
:hover::-moz-placeholder { /* Firefox 19+ */
color: #999;
}
:hover:-ms-input-placeholder { /* IE 10+ */
color: #999;
}
:hover:-moz-placeholder { /* Firefox 18- */
color: #999;
}

<input type=text placeholder=Enter your name />





Also note the browser compatibilities.


[#9297] Sunday, January 20, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
matteo

Total Points: 81
Total Questions: 100
Total Answers: 96

Location: Honduras
Member since Sat, Jul 24, 2021
3 Years ago
matteo questions
Tue, Mar 8, 22, 00:00, 2 Years ago
Sun, May 31, 20, 00:00, 4 Years ago
Thu, Mar 12, 20, 00:00, 4 Years ago
Wed, Sep 12, 18, 00:00, 6 Years ago
Sun, Jul 29, 18, 00:00, 6 Years ago
;