有没有办法让标签响应焦点.我有一些代码,其中textfield在焦点上有不同的样式.然而,标签也需要略有不同的风格.我尝试了这个,但它没有影响标签.
#header .search label { background:url(http://www.golfbrowser.com/images/icons/search.png) left top no-repeat; padding-left:20px; height:20px; float:right; } #header .search label:focus { background:url(http://www.golfbrowser.com/images/icons/search-z.png) left top no-repeat; padding-left:20px; height:20px; float:right; } #header .search input { padding:0px; border:0px; width:140px; height:20px; float:left; padding-right:10px; background:url(http://www.golfbrowser.com/images/icons/searchbar.png) right top no-repeat; } #header .search input:focus { padding:0px; width:190px; height:20px; float:left; padding-right:10px; background:url(http://www.golfbrowser.com/images/icons/searchbar-z.png) right top no-repeat; }
标签包含图像和圆角的另一部分,它也必须改变颜色才能使字段看起来正确.
有任何想法吗,
奇妙