Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题在主题中。
您可以像这样使用CSS 伪类选择器:
textarea:focus { background-color: red }
请注意,这不适用于 IE7 和更低版本。
示范:)
textarea:focus { background-color: #00ff00; }
input[type='text']:focus { background-color: #0066FF; }