51help TIY
码:
<!DOCTYPE html> <html> <head> <style> input:focus { background-color:yellow; } </style> </head> <body> <p>背景:</p> <form> First name: <input type="text" name="firstname" /><br> Last name: <input type="text" name="lastname" /> </form> <p><b>注释:</b>如果 :focus 用于 IE8 明 <!DOCTYPE>。</p> </body> </html>
查看结果: